ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.56k stars 9.97k forks source link

youtube-dl cookies in config.txt #28526

Open wankio opened 3 years ago

wankio commented 3 years ago

Checklist

Question

WRITE QUESTION HERE

-o I:/youtube-dl/%(extractor)s/%(title)s-%(uploader)s-%(channel_id)s-%(channel)s-%(id)s.%(ext)s
-f bestvideo[height<=?1080]+bestaudio/best
--write-thumbnail 
--cookies C:\Users\GEN32UC\AppData\Roaming\youtube-dl\cookies.txt
--write-sub
--write-auto-sub
--sub-lang en-GB

i'm download video on facebook, but cookies wont work, i need to add it into command instead

eg: youtube-dl facebookURL --cookies C:\Users\GEN32UC\AppData\Roaming\youtube-dl\cookies.txt

did my config file is wrong ? ty

dstftw commented 3 years ago

Post verbose log.

wankio commented 3 years ago
[debug] System config: []
[debug] User config: ['-o', 'I:/youtube-dl/%(extractor)s/%(title)s-%(uploader)s-%(channel_id)s-%(channel)s-%(id)s.%(ext)s', '-f', 'bestvideo[height<=?1080]+bestaudio/best', '--write-thumbnail', '--cookies', 'C:UsersGEN32UCAppDataRoamingyoutube-dlcookies.txt', '--write-sub', '--write-auto-sub', '--sub-lang', 'en-GB']
[debug] Custom config: []
[debug] Command-line args: ['https://www.facebook.com/bryan.castillo.5836711/videos/1825626214282572', '--verbose']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dl version 2021.03.14
[debug] Python version 3.8.2 (CPython) - Windows-10-10.0.19041-SP0
[debug] exe versions: ffmpeg N-92966-gd52a1be4e3, ffprobe N-92966-gd52a1be4e3
[debug] Proxy map: {}
[facebook] 1825626214282572: Downloading webpage
[facebook] 1825626214282572: Downloading webpage
ERROR: Cannot parse data; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "c:\users\gen32uc\appdata\local\programs\python\python38\lib\site-packages\youtube_dl\YoutubeDL.py", line 806, in wrapper
    return func(self, *args, **kwargs)
  File "c:\users\gen32uc\appdata\local\programs\python\python38\lib\site-packages\youtube_dl\YoutubeDL.py", line 827, in __extract_info
    ie_result = ie.extract(url)
  File "c:\users\gen32uc\appdata\local\programs\python\python38\lib\site-packages\youtube_dl\extractor\common.py", line 534, in extract
    ie_result = self._real_extract(url)
  File "c:\users\gen32uc\appdata\local\programs\python\python38\lib\site-packages\youtube_dl\extractor\facebook.py", line 677, in _real_extract
    return self._extract_from_url(real_url, video_id)
  File "c:\users\gen32uc\appdata\local\programs\python\python38\lib\site-packages\youtube_dl\extractor\facebook.py", line 591, in _extract_from_url
    raise ExtractorError('Cannot parse data')
youtube_dl.utils.ExtractorError: Cannot parse data; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
FoxMcloud5655 commented 3 years ago

I think I found your problem... Are you running this from a batch script? If so, you need to double escape your \ symbols.

C:UsersGEN32UCAppDataRoamingyoutube-dlcookies.txt

The above is what's passed to youtube-dl.

pukkandan commented 3 years ago

Use / instead of \ as a workaround

wankio commented 3 years ago

I think I found your problem... Are you running this from a batch script? If so, you need to double escape your \ symbols.

C:UsersGEN32UCAppDataRoamingyoutube-dlcookies.txt

The above is what's passed to youtube-dl.

no i'm just calling youtube-dl in command

Use / instead of \ as a workaround

i'm confirmed this working, maybe i forgot change / to \ in the last time edit cookies in config file