Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[instagram][error] An unexpected error occurred: TypeError - '>' not supported between instances of 'tuple' and 'int'. #1990

Closed
brsk93 opened this issue Oct 29, 2021 · 4 comments
Labels

Comments

@brsk93
Copy link

brsk93 commented Oct 29, 2021

Trying to download from instagram using Tor socks proxy gives me this error.
I've been using 1.18.4 for a while and it worked. 1.19.0 didn't have proxy support at all so I skipped it. The only other difference that comes to mind is I edited the conf file to use the sleep intervals new option.
Log below. Bit of context, I'm using gallery-dl in a batch script that loops every 10 minutes or so and keeps trying to scrape a profile until it succeeds.

[gallery-dl][debug] Version 1.19.1
[gallery-dl][debug] Python 3.7.9 - Windows-7-6.1.7601-SP1
[gallery-dl][debug] requests 2.25.1 - urllib3 1.25.11
[gallery-dl][debug] Starting DownloadJob for 'https://www.instagram.com/REDACTED'
[instagram][debug] Using InstagramUserExtractor for 'https://www.instagram.com/REDACTED'
[instagram][debug] Using InstagramPostsExtractor for 'https://www.instagram.com/REDACTED/posts/'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): www.instagram.com:443
[socks][debug] Error connecting to SOCKS5 proxy localhost:9050 due to: [WinError 10061] No connection could be made because the target machine actively refused it
[socks][debug] Error connecting to SOCKS5 proxy localhost:9050 due to: [WinError 10061] No connection could be made because the target machine actively refused it
[instagram][debug] SOCKSHTTPSConnectionPool(host='www.instagram.com', port=443): Max retries exceeded with url: /REDACTED/ (Caused by NewConnectionError('<urllib3.contrib.socks.SOCKSHTTPSConnection object at 0x0481C0B0>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')) (1/11)
[instagram][error] An unexpected error occurred: TypeError - '>' not supported between instances of 'tuple' and 'int'. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .
[instagram][debug]
Traceback (most recent call last):
File "gallery_dl\job.pyc", line 80, in run
File "gallery_dl\extractor\instagram.pyc", line 48, in items
File "gallery_dl\extractor\instagram.pyc", line 427, in posts
File "gallery_dl\extractor\instagram.pyc", line 341, in _extract_profile_page
File "gallery_dl\extractor\instagram.pyc", line 328, in _extract_shared_data
File "gallery_dl\extractor\instagram.pyc", line 76, in request
File "gallery_dl\extractor\common.pyc", line 167, in request
TypeError: '>' not supported between instances of 'tuple' and 'int'

@brsk93
Copy link
Author

brsk93 commented Oct 29, 2021

I was doing some testing and it seems to be working now, somehow. I don't think I changed anything significant. Maybe it was just a server issue. Weird.

@Hrxn
Copy link
Contributor

Hrxn commented Oct 30, 2021

Probably a Tor proxy issue..
Seriously, why would you download stuff from IG via Tor?

@mikf mikf closed this as completed in dad2875 Oct 30, 2021
@mikf mikf added the bug label Oct 30, 2021
@mikf
Copy link
Owner

mikf commented Oct 30, 2021

This was an actual bug in gallery-dl that only happened when an HTTP request was retried and sleep-request had a minimum and maximum set, which is the default for Instagram.

As a workaround, you can set the sleep interval to a fixed value:
-o sleep-request=9

1.19.0 didn't have proxy support at all

The .exe from the Releases page didn't support SOCKS proxies. HTTP proxies worked. The ones built by the executables Github action, however, always come with SOCKS proxy support. Even the 1.19.0 version, which also has the bug from this issue.

@brsk93
Copy link
Author

brsk93 commented Oct 30, 2021

Probably a Tor proxy issue.. Seriously, why would you download stuff from IG via Tor?

The connection I'm using has a static IP and I'm not willing to make an account (would be flagged as bot anyway eventually). Tor allows me to run a script that keeps trying to download and uses different IPs whenever Tor changes circuits, thus circumventing any blocks given enough time. The added privacy is also a nice bonus when dealing with anything owned by FB.

@mikf
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants