[YT] Fix --cookies option for Python 2.7 (works only with Python3)
See original GitHub issueChecklist
- I’m reporting a broken site support issue
- I’ve verified that I’m running youtube-dlc version 2020.10.31
- I’ve checked that all provided URLs are alive and playable in a browser
- I’ve checked that all URLs and arguments with special characters are properly quoted or escaped
- I’ve searched the bugtracker for similar bug reports including closed ones
- I’ve read bugs section in FAQ
Verbose log
./dlctest -v -F --cookies cooktest.txt https://www.youtube.com/watch?v= XgnwCQzjau8
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-F', u'--cookies', u'cooktest.txt', u'https://www.youtube.com/watch?v= XgnwCQzjau8']
[debug] Loading archive file None
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dlc version 2020.11.11-2
[debug] Python version 2.7.16 (CPython) - Darwin-19.6.0-x86_64-i386-64bit
[debug] exe versions: none
[debug] Proxy map: {}
[youtube] XgnwCQzjau8: Downloading webpage
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "./dlctest/main.py", line 19, in
File "./dlctest/youtube_dlc/init.py", line 487, in main
File "./dlctest/youtube_dlc/init.py", line 477, in _real_main
File "./dlctest/youtube_dlc/YoutubeDL.py", line 2104, in download
File "./dlctest/youtube_dlc/YoutubeDL.py", line 830, in extract_info
File "./dlctest/youtube_dlc/extractor/common.py", line 532, in extract
File "./dlctest/youtube_dlc/extractor/youtube.py", line 1865, in _real_extract
File "./dlctest/youtube_dlc/extractor/common.py", line 2866, in get_cookies File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/Cookie.py", line 583, in init if input: self.load(input) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/Cookie.py", line 643, in load for k, v in rawdata.items(): AttributeError: 'unicode' object has no attribute 'items'
Description
This issue was described here https://github.com/blackjack4494/yt-dlc/issues/175#issuecomment-725942303 and --cookies option now works only on Python3.
Test link: https://www.youtube.com/watch?v=XgnwCQzjau8
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
[Question] · Issue #175 · blackjack4494/yt-dlc · GitHub
I used the cookies extension (both, the current site and all the sites option) ... [YT] Fix --cookies option for Python 2.7 (works...
Read more >Cheat Sheet: Writing Python 2-3 compatible code
The futurize and python-modernize tools do not currently offer an option to do this automatically. If you are writing code for a new...
Read more >Python: use cookie to login with Selenium - Stack Overflow
From what I've understood, I have to use cookies, the problem is that I can't understand how. I tried to download youtube cookies...
Read more >PROBLEM SET 8: COOKIE JAR | SOLUTION (CS50 PYTHON)
Are You A Coding Expert? Take Our Free Quiz and Find Out: https://www.dorscodingschool.com/quiz▻ Free Discord Group: ...
Read more >Porting Python 2 Code to Python 3 — Python 3.11.1 ...
While you can make Python 2.5 work with Python 3, it is much easier if you only have to work with Python 2.7....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I would recommend to stop supporting python 2. It has caused decades of headaches to the community and we have to draw a line somewhere. For more information please see: https://python3statement.org/ https://pythonclock.org/ If enough projects drop support for python 2, pressure will add up to force stragglers to update.
Ports etc etc have python3. Let PYthon 2 die. Kill it if you have to.