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.31k stars 9.95k forks source link

Can't download video dailymotion on VPS ubuntu 20.04 #26044

Open quocduongpy opened 4 years ago

quocduongpy commented 4 years ago

Verbose log

youtube-dl --verbose https://www.dailymotion.com/video/x7uy9hv
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--verbose', u'https://www.dailymotion.com/video/x7uy9hv']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.06.16.1
[debug] Python version 2.7.18rc1 (CPython) - Linux-5.4.0-31-generic-x86_64-with-Ubuntu-20.04-focal
[debug] exe versions: ffmpeg 4.2.2, ffprobe 4.2.2
[debug] Proxy map: {}
[dailymotion] Downloading Access Token
[dailymotion] x7uy9hv: Downloading media JSON metadata
[dailymotion] x7uy9hv: Downloading metadata JSON
[dailymotion] x7uy9hv: Downloading m3u8 information
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on u'https://proxy-29.sv4.dailymotion.com/sec(cUKYGrKBQNa9lM5okzRjBF3WzhusvYSzCwGKD_wKHwGwjIILEHmSGbsZNVVFtRc9cjut3sTc8FdRg1dvh0HfNQ)/video/323/052/475250323_mp4_h264_aac_fhd_hfr.mp4'
ERROR: unable to download video data: HTTP Error 403: Forbidden
Traceback (most recent call last):
  File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1926, in process_info
    success = dl(filename, info_dict)
  File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1865, in dl
    return fd.download(name, info)
  File "/usr/bin/youtube-dl/youtube_dl/downloader/common.py", line 366, in download
    return self.real_download(filename, info_dict)
  File "/usr/bin/youtube-dl/youtube_dl/downloader/http.py", line 341, in real_download
    establish_connection()
  File "/usr/bin/youtube-dl/youtube_dl/downloader/http.py", line 109, in establish_connection
    ctx.data = self.ydl.urlopen(request)
  File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2238, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python2.7/urllib2.py", line 435, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 548, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 473, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 556, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 403: Forbidden

Description

Hello This command works fine on MacOS, but I do not understand when used on VPS Ubuntu 20.04. youtube-dl -j https://www.dailymotion.com/video/x7uy9hv --> No error youtube-dl https://www.dailymotion.com/video/x7uy9hv --> ERROR: unable to download video data: HTTP Error 403: Forbidden

THANKS YOU SO MUCH.

BassOfBass commented 3 years ago

That's the problem:

[debug] Python version 2.7.18rc1 (CPython) - Linux-5.4.0-31-generic-x86_64-with-Ubuntu-20.04-focal

You need to force your VPS to use python3 for youtube-dl.