mercuree / html-telegraph-poster Goto Github PK
View Code? Open in Web Editor NEWPython html to telegra.ph poster (telegram article service)
License: MIT License
Python html to telegra.ph poster (telegram article service)
License: MIT License
tried with iframe and video tag, but given error is empty content
I have a page that I created earlier. How can I change it? Something like code:
link_page = 'https://telegra.ph/mypagetoedit'
t.edit(link_page, text=link_page.text + 'my new text')
When you post a text with <br>
s in it, TelegraphPoster just ignores them.
Is there a way to put an article description for a link preview?
The page I generated doesn't support instant view (there's no button in the message)
Cannot get token, see the error
requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='api.telegra.ph', port=443): Max retries exceeded with url: /createAccount?short_name=Elon+Musk&author_name=Elon&author_url=https%3A%2F%2Fwww.spacex.com%2F (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x000002D970B8F4C0>, 'Connection to api.telegra.ph timed out. (connect timeout=None)'))
I don't know why but
https://telegr.ph/ stopped working and i think because of that this library not working for me
instead now http://te.legra.ph/ is working and used.
I always use post method to post new articles. but very often my old post (previous one) is updated, instead of being posted as a new article with new link.
Hello.
Could you add the ability to work through a proxy?
Best regards.
I am a regular user and use this great module in my project, still a sudden error occurred
File "/app/.heroku/python/lib/python3.9/site-packages/telegram/ext/utils/promise.py", line 96, in run
self._result = self.pooled_function(*self.args, **self.kwargs)
File "/app/Sagiri/__main__.py", line 211, in doujin
post = nyah.post(title = f"{hen.title()}", author = "DontKnow", text = tx)
File "/app/.heroku/python/lib/python3.9/site-packages/html_telegraph_poster/html_to_telegraph.py", line 147, in post
result = self.edit()
File "/app/.heroku/python/lib/python3.9/site-packages/html_telegraph_poster/html_to_telegraph.py", line 164, in edit
result = _upload_via_api(access_token=self.access_token, path=path or self.path, **params)
File "/app/.heroku/python/lib/python3.9/site-packages/html_telegraph_poster/html_to_telegraph.py", line 85, in _upload_via_api
resp = requests.post(api_url + method, params, headers={'User-Agent': user_agent}).json()
File "/app/.heroku/python/lib/python3.9/site-packages/requests/models.py", line 910, in json
return complexjson.loads(self.text, **kwargs)
File "/app/.heroku/python/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/app/.heroku/python/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/app/.heroku/python/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
It looks like telegram isnt giving json responses, i still dont know though what is wrong, because it was working for two months as a telegram bot deployed on heroku, so it is a Telegraph server error i guess, but i when i tried it in my terminal it worked perfectly! What could be the problem i am facing, is Telegraph blocking my ip or something? . Please Help if you can Thanks!
Recently, I have been experiencing an issue when trying to upload an image file using the command html_telegraph_poster.upload_images("file_path.jpg")
. This issue has become more frequent, to the point where I am no longer able to upload images.
Doing some testsing I was able to discover that the result of the request for the upload was <Response [500]>
.
I also tried to upload the image by myself imitating the method used here (changing some parameters) but without any success.
But I've found this website, which could upload the same images without anz problem.
Does anzone have anz solution for this?
The url returned is always http://telegra.ph/xxx. I think it will be safer to use https://
I guess changing the base_url from 'http://telegra.ph' into 'https://telegra.ph' in html_to_telegraph.py can fix the problem.
I am getting this error when I am trying to post in telegraph using your module please help
Hi! This is best poster for telegraph but I have seen that if I use author It give me html code in my post and not url to website.
url = 'http://.... '
writer = 'john johnson'
t = TelegraphPoster()
result = t.post(title=titolo, author=writer, text=testo)
Am I wrong doing something wrong?
P.S. In text field hypertext url works fine.
Is it a good idea to add a parameter option auto_upload_images
:
When this parameter is used, the images in the <img>
tag will be automatically uploaded and the URLs will be replaced.
I'd like to bring to your attention that we are discussing the possibility of removing lxml's clean_html functionality from lxml library. Over the past years, there have been several concerning security vulnerabilities discovered within the lxml library's clean_html functionality โ CVE-2021-43818, CVE-2021-28957, CVE-2020-27783, CVE-2018-19787 and CVE-2014-3146.
The main problem is in the design. Because the lxml's clean_html functionality is based on a blocklist, it's hard to keep it up to date with all new possibilities in HTML and JS.
Two viable alternatives worth considering are bleach
and nh3
. Here's why:
bleach:
nh3:
We'll probably move the cleaning part of the lxml to a distinct project first so it will still be possible to use it but better is to find a suitable alternative sooner rather than later.
Let me know if we can help you with this transition anyhow and have a nice day.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.