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

(Request) "Forward cookies to youtube-dl" disable option #352

Closed
open-mindt opened this issue Jul 24, 2019 · 1 comment
Closed

(Request) "Forward cookies to youtube-dl" disable option #352

open-mindt opened this issue Jul 24, 2019 · 1 comment

Comments

@open-mindt
Copy link

After upgrade to 1.9.0, All twitter videos are failed to download. The problem is youtube-dl.
Download twitter videos(whether private or not) using youtube-dl with cookies are all failed.
I reported this issue three months ago. but They had no response.
So please make "Forward cookies to youtube-dl" disable option.

I got curious while I was writing this request. I usually use gallery-dl with cookies for download twitter timeline and media. Never use for download individual tweet, so had a test.

No option is fine.. download well.

PS D:\> gallery-dl -v https://twitter.com/F1/status/1153418204561235970
[gallery-dl][debug] Version 1.9.0
[gallery-dl][debug] Python 3.7.3 - Windows-10-10.0.18362-SP0
[gallery-dl][debug] requests 2.21.0 - urllib3 1.24
[gallery-dl][debug] Starting DownloadJob for 'https://twitter.com/F1/status/1153418204561235970'
[gallery-dl][debug] Updating urllib3 ciphers
[twitter][debug] Using TwitterTweetExtractor for 'https://twitter.com/F1/status/1153418204561235970'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): twitter.com:443
[urllib3.connectionpool][debug] https://twitter.com:443 "GET /F1/status/1153418204561235970 HTTP/1.1" 200 68271
# .\gallery-dl\twitter\F1\1153418204561235970_1.jpg

--cookies have an issue. --netrc and -u -p are also happend the same issue.

PS D:\> gallery-dl -v --cookies cookies.txt https://twitter.com/F1/status/1153418204561235970
[gallery-dl][debug] Version 1.9.0
[gallery-dl][debug] Python 3.7.3 - Windows-10-10.0.18362-SP0
[gallery-dl][debug] requests 2.21.0 - urllib3 1.24
[gallery-dl][debug] Starting DownloadJob for 'https://twitter.com/F1/status/1153418204561235970'
[gallery-dl][debug] Updating urllib3 ciphers
[twitter][debug] Using TwitterTweetExtractor for 'https://twitter.com/F1/status/1153418204561235970'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): twitter.com:443
[urllib3.connectionpool][debug] https://twitter.com:443 "GET /F1/status/1153418204561235970 HTTP/1.1" 200 526
[twitter][error] An unexpected error occurred: AttributeError - 'NoneType' object has no attribute 'index'. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .
Traceback (most recent call last):
  File "c:\python\lib\site-packages\gallery_dl\job.py", line 47, in run
    for msg in self.extractor:
  File "c:\python\lib\site-packages\gallery_dl\extractor\twitter.py", line 43, in items
    data = self._data_from_tweet(tweet)
  File "c:\python\lib\site-packages\gallery_dl\extractor\twitter.py", line 98, in _data_from_tweet
    extr = text.extract_from(tweet)
  File "c:\python\lib\site-packages\gallery_dl\text.py", line 168, in extract_from
    def extr(begin, end, index=txt.index, txt=txt):
AttributeError: 'NoneType' object has no attribute 'index'

I don't know whether this issue only happens to me or not. but report this just in case.

mikf added a commit that referenced this issue Jul 24, 2019
The "long" name is necessary because just calling it 'cookies' would
clash with how the lookup for '--cookies' is implemented.
@mikf
Copy link
Owner

mikf commented Jul 24, 2019

There is now a downloader.ytdl.forward-cookies option to enable/disable the cookie forwarding to youtube-dl.

I've "investigated" a bit and discovered that Twitter is using a new layout only for logged-in users. Basically everything there is loaded asynchronously and tweet data is no longer part of the basic HTML website, which is why downloading from individual tweets with cookies is failing.

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