I am using instagram-scraper for scrapping, it runs fine from the console but the scraped files have zero bytes size.
I am using instagram-scraper for scrapping, it runs fine from the console but the scraped files have zero bytes size.
It sounds like the download itself is failing for some reason. I would expect that there would be an error message telling you that somewhere in the output or logs.
No I am not getting any error on console or log.
That seems weird. I would think it should report errors like that and the reason for them. Perhaps you can ask the developers of the software where the error messages go when something fails to download.
The module have a logger to log if error may arise. And the software is working quite fine on my local machine.
https://github.com/althonos/InstaLooter
Traceback (most recent call last):
File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/home/BitJunky/.local/lib/python3.5/site-packages/instaLooter/worker.py", line 46, in run
self._download_photo(media)
File "/home/BitJunky/.local/lib/python3.5/site-packages/instaLooter/worker.py", line 88, in _download_photo
self._dl(photo_url, photo_name)
File "/home/BitJunky/.local/lib/python3.5/site-packages/instaLooter/worker.py", line 117, in _dl
with contextlib.closing(self.session.get(source)) as res:
File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 487, in get
return self.request('GET', url, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 475, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 585, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/requests/adapters.py", line 465, in send
raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='scontent.cdninstagram.com', port=443): Max retries exceeded with url: /t51.2885-15/e35/17332693_396835120675693_8857048473678118912_n.jpg (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden',)))
It looks like you're trying to access a site that's not on the list of whitelisted sites for free accounts. If it's a site with an official, supported API, then send us a link to the documentation and we'll see if we can whitelist it.
Hi, This module only connect to https://cdninstagram.com. Please add it to white-list. The documentation is here. Also, This module cannot use any proxy Thanks for your help
In order to whitelist something we need official API documentation from the site that needs to be whitelisted; the link you gave goes to a third-party library called "Instalooter" which explicitly says that it's bypassing the Instagram API, so that's not really official...
Hello, Could you please add telethon (official Telegram APi) into white list?
Could you give a link to the API documentation?
The link is: https://github.com/LonamiWebs/Telethon
The link is here: https://telethon.readthedocs.io/en/stable/
Hmm, if that's just connecting to Telegram then it should already work -- all of their servers are whitelisted as far as we know. However, if it's trying to connect over websockets then that won't work from a free account -- our whitelisting system doesn't handle websockets to any server.
What error are you getting when you use it?
Do you use proxy to connect to telegram? My bot can not connect to telegram and get this error: Attempt 1 at connecting failed: GeneralProxyError: Socket error: 403: Forbidden [*] Note: The HTTP proxy server may not be supported by PySocks (must be a CONNECT tunnel proxy) Can you help me?
Yes, you'll need to use the proxy to connect to Telegram from a free account.
Could you give the full error traceback?
The full error:
INFO:telethon.network.mtprotosender:Connecting to 149.154.167.51:443...
DEBUG:telethon.network.mtprotosender:Connection attempt 1...
WARNING:telethon.network.mtprotosender:Attempt 1 at connecting failed: GeneralProxyError: Socket error: 403: Forbidden
[*] Note: The HTTP proxy server may not be supported by PySocks (must be a CONNECT tunnel proxy)
DEBUG:telethon.network.mtprotosender:Connection attempt 2...
WARNING:telethon.network.mtprotosender:Attempt 2 at connecting failed: ConnectionResetError:
DEBUG:telethon.network.mtprotosender:Connection attempt 3...
WARNING:telethon.network.mtprotosender:Attempt 3 at connecting failed: ConnectionResetError:
DEBUG:telethon.network.mtprotosender:Connection attempt 4...
WARNING:telethon.network.mtprotosender:Attempt 4 at connecting failed: ConnectionResetError:
DEBUG:telethon.network.mtprotosender:Connection attempt 5...
WARNING:telethon.network.mtprotosender:Attempt 5 at connecting failed: ConnectionResetError:
Traceback (most recent call last):
File "/home/yi6o9/test/tele.py", line 17, in <module>
client.start()
File "/home/yi6o9/.local/lib/python3.6/site-packages/telethon/client/auth.py", line 106, in start
max_attempts=max_attempts
File "/home/yi6o9/.local/lib/python3.6/site-packages/telethon/client/auth.py", line 116, in _start
self.connect()
File "/home/yi6o9/.local/lib/python3.6/site-packages/telethon/client/telegrambaseclient.py", line 288, in connect
self.session.server_address, self.session.port)
File "/home/yi6o9/.local/lib/python3.6/site-packages/telethon/network/mtprotosender.py", line 128, in connect
self._connect()
File "/home/yi6o9/.local/lib/python3.6/site-packages/telethon/network/mtprotosender.py", line 253, in _connect
.format(self._retries))
ConnectionError: Connection to Telegram failed 5 times
[edit by admin: formatting]
Ah, I see -- it's not using HTTP, it's using Telegram's MTProto protocol. Unfortunately that won't work on a free account on PythonAnywhere :-( We only support HTTP and HTTPS for free accounts.