yt-dlc icon indicating copy to clipboard operation
yt-dlc copied to clipboard

[Question]

Open Mandrake158 opened this issue 4 years ago • 9 comments

Checklist

  • [ x] I'm asking a question
  • [ x] I've looked through the README and FAQ for similar questions
  • [ x] I've searched the bugtracker for similar questions including closed ones

Question

WRITE QUESTION HERE

So I was trying to download the video sited in here https://github.com/blackjack4494/yt-dlc/issues/7 and while its true that youtube-dl downloads something, like @nbmrjuhneibkr said, it just downloads a test video that says it is age restricted, not the actual video

Edit: I got confused, he posted a test video and it has similar link, but the https://www.youtube.com/watch?v=7takIh1nK0s can't download

I used the cookies extension (both, the current site and all the sites option) and have the "--cookies cookies.txt" paramether and I still get the "ERROR: Video is age restricted and only playable on Youtube. Requires cookies!"

Here is my config, I have no problem with it on YT-DL so I'm guessing they all work in here too.. Its the only video I haven't been able to download config.txt

Edit2: After trying and retrying for some time, it finally worked.. Guess it was an issue with th YT connection?

Mandrake158 avatar Nov 11 '20 17:11 Mandrake158

Also getting an error here with the latest release - 2020.11.11-2/3 Log below:

_./dlctest -v -F --cookies cooktest.txt https://www.youtube.com/watch?v=7takIh1nK0s [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=7takIh1nK0s'] [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] 7takIh1nK0s: 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'

@insaneracist could this be python version related? This link also fails: https://www.youtube.com/watch?v=XgnwCQzjau8

someziggyman avatar Nov 12 '20 00:11 someziggyman

Yeah it seems there is a problem with YT tonight, I got scared as I downloaded the whole Unus Annus + some concerts + some videos and while downloading the last Unus one I got error 503.. thought YT temporarily suspended my IP.. but using VPN, phone, etc doesn’t load.. and online people are saying it’s down to them too

So I’ll guess we need to try later

Mandrake158 avatar Nov 12 '20 01:11 Mandrake158

Also getting an error here with the latest release - 2020.11.11-2/3 Log below:

_./dlctest -v -F --cookies cooktest.txt https://www.youtube.com/watch?v=7takIh1nK0s [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=7takIh1nK0s'] [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] 7takIh1nK0s: 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'

@insaneracist could this be python version related? This link also fails: https://www.youtube.com/watch?v=XgnwCQzjau8

this link - https://www.youtube.com/watch?v=XgnwCQzjau8 works if you use the cookies option.

and this link here - https://www.youtube.com/watch?v=7takIh1nK0s also works if you use the cookies option. just make sure that you are signed in to youtube when using the cookies option.

october262 avatar Nov 12 '20 03:11 october262

Also getting an error here with the latest release - 2020.11.11-2/3 Log below: _./dlctest -v -F --cookies cooktest.txt https://www.youtube.com/watch?v=7takIh1nK0s [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=7takIh1nK0s'] [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] 7takIh1nK0s: 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' @insaneracist could this be python version related? This link also fails: https://www.youtube.com/watch?v=XgnwCQzjau8

this link - https://www.youtube.com/watch?v=XgnwCQzjau8 works if you use the cookies option.

and this link here - https://www.youtube.com/watch?v=7takIh1nK0s also works if you use the cookies option. just make sure that you are signed in to youtube when using the cookies option.

I am logged in to YT using Chrome, immediately creating a cookie file with https://chrome.google.com/webstore/detail/get-cookiestxt/bgaddhkoddajcdgocldbbfleckgcbcid used --rm-cache-dir and --no-cache-dir. Neither helped. Running MacOS with Python 2.7 am I doing something wrong? any advice is appreciated.

Just out of curiosity tried with --username -- password params and got ERROR: Video is age restricted and only playable on Youtube. Requires cookies! which is probably expected behavior.

someziggyman avatar Nov 12 '20 08:11 someziggyman

retry like this > youtube-dlc https://www.youtube.com/watch?v=7takIh1nK0s --cookies cookies.txt -f mp4 see if that works

october262 avatar Nov 12 '20 08:11 october262

retry like this > youtube-dlc https://www.youtube.com/watch?v=7takIh1nK0s --cookies cookies.txt -f mp4 see if that works

Nope.. it's the same crash as in my initial report.

@blackjack4494 @insaneracist However, if I use Python 3 it works like a charm! It's definitely Python version problem on how cookies file is handled. might be again some "str" variable as it was in some playlist case, if I remember correctly. Hope someone can make it compatible with python 2.7 as may MacOS users are running it in terminal out of the box.

someziggyman avatar Nov 12 '20 09:11 someziggyman

run sudo apt install python3-pip install that and then run python3 -m pip install --upgrade youtube-dlc

october262 avatar Nov 12 '20 09:11 october262

run sudo apt install python3-pip install that and then run python3 -m pip install --upgrade youtube-dlc

Thanks for your help. Installing and using Python3 is not a problem, however, like I said thousands of ytdlc users can be and are running 2.7 in MacOS Terminal. Making cookie functionality compatible with 2.7 will just help with future duplicate issue reports like this and will make the tool more flexible.

someziggyman avatar Nov 12 '20 09:11 someziggyman

This line probably triggers the error cookie_keys = self._get_cookies('https://www.youtube.com').keys()
There is seems to be a problem when using keys()

blackjack4494 avatar Nov 17 '20 23:11 blackjack4494