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

Twitter error when downloading videos #768

Closed
KaMyKaSii opened this issue May 20, 2020 · 6 comments
Closed

Twitter error when downloading videos #768

KaMyKaSii opened this issue May 20, 2020 · 6 comments
Labels

Comments

@KaMyKaSii
Copy link

[gallery-dl][debug] Version 1.14.0-dev
[gallery-dl][debug] Python 3.8.3 - Linux-4.4.141-perf+-aarch64-with-libc
[gallery-dl][debug] requests 2.23.0 - urllib3 1.25.9
[gallery-dl][debug] Starting DownloadJob for 'https://twitter.com/Asecresm/media'
[twitter][debug] Using TwitterMediaExtractor for 'https://twitter.com/Asecresm/media'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): twitter.com:443
[urllib3.connectionpool][debug] https://twitter.com:443 "GET /i/profiles/show/Asecresm/media_timeline?include_available_features=1&include_entities=1&reset_error_state=false&lang=en HTTP/1.1" 200 15701
/sdcard/gallery-dl/twitter/Asecresm/1263064925460545536_1.jpg
/sdcard/gallery-dl/twitter/Asecresm/1263064925460545536_2.jpg
/sdcard/gallery-dl/twitter/Asecresm/1263064925460545536_3.jpg
/sdcard/gallery-dl/twitter/Asecresm/1263064925460545536_4.jpg
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): api.twitter.com:443
[urllib3.connectionpool][debug] https://api.twitter.com:443 "POST /1.1/guest/activate.json HTTP/1.1" 200 62
[urllib3.connectionpool][debug] https://api.twitter.com:443 "GET /1.1/videos/tweet/config/1262500686249332736.json HTTP/1.1" 200 1210
[twitter][error] An unexpected error occurred: AttributeError - 'YoutubeDLDownloader' object has no attribute 'session'. 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 "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gallery_dl/job.py", line 62, in run
    self.dispatch(msg)
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gallery_dl/job.py", line 96, in dispatch
    self.handle_url(url, kwds)
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gallery_dl/job.py", line 232, in handle_url
    if not self.download(url):
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gallery_dl/job.py", line 327, in download
    return downloader.download(url, self.pathfmt)
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gallery_dl/downloader/ytdl.py", line 49, in download
    for cookie in self.session.cookies:
AttributeError: 'YoutubeDLDownloader' object has no attribute 'session'
$
@kattjevfel
Copy link
Contributor

Do you have youtube-dl installed?

@KaMyKaSii
Copy link
Author

KaMyKaSii commented May 20, 2020

Do you have youtube-dl installed?

Sure

$ youtube-dl --version
2020.05.08

Until yesterday (19/05) the download of Twitter videos was working perfectly

@kattjevfel
Copy link
Contributor

Weird, works flawlessly here, can you try with --ignore-config?

gallery-dl --ignore-config --verbose https://twitter.com/Asecresm/status/1262500686249332736
[gallery-dl][debug] Version 1.14.0-dev
[gallery-dl][debug] Python 3.8.3 - Linux-5.6.13-zen1-1-zen-x86_64-with-glibc2.2.5
[gallery-dl][debug] requests 2.23.0 - urllib3 1.25.9
[gallery-dl][debug] Starting DownloadJob for 'https://twitter.com/Asecresm/status/1262500686249332736'
[twitter][debug] Using TwitterTweetExtractor for 'https://twitter.com/Asecresm/status/1262500686249332736'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): twitter.com:443
[urllib3.connectionpool][debug] https://twitter.com:443 "GET /i/web/status/1262500686249332736 HTTP/1.1" 200 63618
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): api.twitter.com:443
[urllib3.connectionpool][debug] https://api.twitter.com:443 "POST /1.1/guest/activate.json HTTP/1.1" 200 63
[urllib3.connectionpool][debug] https://api.twitter.com:443 "GET /1.1/videos/tweet/config/1262500686249332736.json HTTP/1.1" 200 1210
[downloader.ytdl][debug] [generic] r9vc3AYg61VVzyEQ: Requesting header
[downloader.ytdl][debug] [generic] r9vc3AYg61VVzyEQ: Downloading m3u8 information
./gallery-dl/twitter/Asecresm/1262500686249332736_1.mp4[downloader.ytdl][debug] [hlsnative] Downloading m3u8 manifest
[downloader.ytdl][debug] [hlsnative] Total fragments: 15
[downloader.ytdl][debug] [download] Destination: ./gallery-dl/twitter/Asecresm/1262500686249332736_1.mp4
...
[download] 100% of 3.35MiB in 00:01
[downloader.ytdl][debug] [ffmpeg] Fixing malformed AAC bitstream in "./gallery-dl/twitter/Asecresm/1262500686249332736_1.mp4"

@KaMyKaSii
Copy link
Author

KaMyKaSii commented May 20, 2020

Weird, works flawlessly here, can you try with --ignore-config?

gallery-dl --ignore-config --verbose https://twitter.com/Asecresm/status/1262500686249332736
[gallery-dl][debug] Version 1.14.0-dev
[gallery-dl][debug] Python 3.8.3 - Linux-5.6.13-zen1-1-zen-x86_64-with-glibc2.2.5
[gallery-dl][debug] requests 2.23.0 - urllib3 1.25.9
[gallery-dl][debug] Starting DownloadJob for 'https://twitter.com/Asecresm/status/1262500686249332736'
[twitter][debug] Using TwitterTweetExtractor for 'https://twitter.com/Asecresm/status/1262500686249332736'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): twitter.com:443
[urllib3.connectionpool][debug] https://twitter.com:443 "GET /i/web/status/1262500686249332736 HTTP/1.1" 200 63618
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): api.twitter.com:443
[urllib3.connectionpool][debug] https://api.twitter.com:443 "POST /1.1/guest/activate.json HTTP/1.1" 200 63
[urllib3.connectionpool][debug] https://api.twitter.com:443 "GET /1.1/videos/tweet/config/1262500686249332736.json HTTP/1.1" 200 1210
[downloader.ytdl][debug] [generic] r9vc3AYg61VVzyEQ: Requesting header
[downloader.ytdl][debug] [generic] r9vc3AYg61VVzyEQ: Downloading m3u8 information
./gallery-dl/twitter/Asecresm/1262500686249332736_1.mp4[downloader.ytdl][debug] [hlsnative] Downloading m3u8 manifest
[downloader.ytdl][debug] [hlsnative] Total fragments: 15
[downloader.ytdl][debug] [download] Destination: ./gallery-dl/twitter/Asecresm/1262500686249332736_1.mp4
...
[download] 100% of 3.35MiB in 00:01
[downloader.ytdl][debug] [ffmpeg] Fixing malformed AAC bitstream in "./gallery-dl/twitter/Asecresm/1262500686249332736_1.mp4"

With --ignore-config it is working.

$ gallery-dl --ignore-config --verbose https://twitter.com/Asecresm/status/1262500686249332736
[gallery-dl][debug] Version 1.14.0-dev
[gallery-dl][debug] Python 3.8.3 - Linux-4.4.141-perf+-aarch64-with-libc
[gallery-dl][debug] requests 2.23.0 - urllib3 1.25.9
[gallery-dl][debug] Starting DownloadJob for 'https://twitter.com/Asecresm/status/1262500686249332736'
[twitter][debug] Using TwitterTweetExtractor for 'https://twitter.com/Asecresm/status/1262500686249332736'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): twitter.com:443
[urllib3.connectionpool][debug] https://twitter.com:443 "GET /i/web/status/1262500686249332736 HTTP/1.1" 200 63197
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): api.twitter.com:443
[urllib3.connectionpool][debug] https://api.twitter.com:443 "POST /1.1/guest/activate.json HTTP/1.1" 200 62
[urllib3.connectionpool][debug] https://api.twitter.com:443 "GET /1.1/videos/tweet/config/1262500686249332736.json HTTP/1.1" 200 1209
[downloader.ytdl][debug] [generic] r9vc3AYg61VVzyEQ: Requesting header
[downloader.ytdl][debug] [generic] r9vc3AYg61VVzyEQ: Downloading m3u8 information
./gallery-dl/twitter/Asecresm/1262500686249332736_1.mp4[downloader.ytdl][debug] [hlsnative] Downloading m3u8 manifest
[downloader.ytdl][debug] [hlsnative] Total fragments: 15
[downloader.ytdl][debug] [download] Destination: ./gallery-dl/twitter/Asecresm/1262500686249332736_1.mp4
...
[download] 100% of 3.35MiB in 00:05
[downloader.ytdl][debug] [ffmpeg] Fixing malformed AAC bitstream in "./gallery-dl/twitter/Asecresm/1262500686249332736_1.mp4"
./gallery-dl/twitter/Asecresm/1262500686249332736_1.mp4

Do you use your account to download? I use a cookie file, maybe Twitter has changed something about the videos when the user is logged in, if I'm not mistaken, there were problems with the Twitter extractor because of this before

@kattjevfel
Copy link
Contributor

I don't log in for twitter stuff no, so it's probably that.

@mikf mikf closed this as completed in 34929f6 May 20, 2020
@mikf mikf added the bug label May 20, 2020
@mikf
Copy link
Owner

mikf commented May 20, 2020

This was a bug introduced in ece73b5 that only happened when ytdl.forward-cookies was explicitly set to true and had nothing to do with anything Twitter related.

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