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

"ValueError - substring not found" trying to download from Twitter #598

Closed
zangafan opened this issue Feb 2, 2020 · 1 comment
Closed

Comments

@zangafan
Copy link

zangafan commented Feb 2, 2020

Trying to download from Twitter while logged in and I'm getting this error. Without logging in, and with removing my conf file, it works just fine, but I have some private accounts I'd like to download from. Is there some stuff missing from my conf file that Twitter now requires or something?

[gallery-dl][debug] Python 3.7.4 - Windows-10-10.0.18362-SP0
[gallery-dl][debug] requests 2.22.0 - urllib3 1.25.3
[gallery-dl][debug] Starting DownloadJob for 'https://twitter.com/ToroborosArt/media'
[twitter][debug] Using TwitterMediaExtractor for 'https://twitter.com/ToroborosArt/media'
[twitter][info] Logging in as nsfwzanga
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): twitter.com:443
[urllib3.connectionpool][debug] https://twitter.com:443 "GET /login HTTP/1.1" 200 None
[twitter][error] An unexpected error occurred: ValueError - substring not found. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .
[twitter][debug]
Traceback (most recent call last):
  File "c:\users\zanga\appdata\local\programs\python\python37\lib\site-packages\gallery_dl\job.py", line 49, in run
    for msg in self.extractor:
  File "c:\users\zanga\appdata\local\programs\python\python37\lib\site-packages\gallery_dl\extractor\twitter.py", line 42, in items
    self.login()
  File "c:\users\zanga\appdata\local\programs\python\python37\lib\site-packages\gallery_dl\extractor\twitter.py", line 113, in login
    self._update_cookies(self._login_impl(username, password))
  File "c:\users\zanga\appdata\local\programs\python\python37\lib\site-packages\gallery_dl\cache.py", line 115, in __call__
    value = self.func(*args, **kwargs)
  File "c:\users\zanga\appdata\local\programs\python\python37\lib\site-packages\gallery_dl\extractor\twitter.py", line 121, in _login_impl
    pos = page.index('name="authenticity_token"')
ValueError: substring not found```
@mikf
Copy link
Owner

mikf commented Feb 2, 2020

Twitter seems to have updated the login page, but you can force the old version by using "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko" as user-agent

This also appears to be the same problem as in #584

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

No branches or pull requests

2 participants