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
132.25k stars 10.03k forks source link

Dailymotion - HTTP 403 Forbidden #23879

Closed Oshan07 closed 4 years ago

Oshan07 commented 4 years ago

Checklist

Verbose log

youtube-dl "https://www.dailymotion.com/video/x7qyx6c" --verbose
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['https://www.dailymotion.com/video/x7qyx6c', '--verbose']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.01.24
[debug] Python version 3.6.9 (CPython) - Linux-4.15.0-66-generic-x86_64-with-Ubuntu-18.04-bionic
[debug] exe versions: ffmpeg 3.4.6, ffprobe 3.4.6, phantomjs ., rtmpdump 2.4
[debug] Proxy map: {}
[dailymotion] Downloading Access Token
[dailymotion] x7qyx6c: Downloading media JSON metadata
[dailymotion] x7qyx6c: Downloading metadata JSON
[dailymotion] x7qyx6c: Downloading m3u8 information
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'https://proxy-24.sv4.dailymotion.com/sec(tm0HAce1IYXKi8ycBP2P4b72lLy0UGMjUmHhjInA-SFv2NTeo1DRJi5_9T7Jnp8GzCWtX0DcfnClHuLhDCSUHw)/video/845/265/468562548_mp4_h264_aac_fhd_7.mp4'
ERROR: unable to download video data: HTTP Error 403: Forbidden
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/YoutubeDL.py", line 1925, in process_info
    success = dl(filename, info_dict)
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/YoutubeDL.py", line 1864, in dl
    return fd.download(name, info)
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/downloader/common.py", line 366, in download
    return self.real_download(filename, info_dict)
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/downloader/http.py", line 341, in real_download
    establish_connection()
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/downloader/http.py", line 109, in establish_connection
    ctx.data = self.ydl.urlopen(request)
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/YoutubeDL.py", line 2237, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python3.6/urllib/request.py", line 532, in open
    response = meth(req, response)
  File "/usr/lib/python3.6/urllib/request.py", line 642, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.6/urllib/request.py", line 570, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.6/urllib/request.py", line 650, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden

Description

Getting HTTP 403 Forbidden error when trying to download videos from www.dailymotion.com. OS: Ubuntu-18.04 The command used to install youtube-dl : pip3 install --upgrade youtube-dl

remitamine commented 4 years ago
youtube-dl --ignore-config https://www.dailymotion.com/video/x7qyx6c
[dailymotion] Downloading Access Token
[dailymotion] x7qyx6c: Downloading media JSON metadata
[dailymotion] x7qyx6c: Downloading metadata JSON
[dailymotion] x7qyx6c: Downloading m3u8 information
[download] Destination: Learn Colors With Clay Slime Hello Kitty For Kids Children Nursery Rhymes-x7qyx6c.mp4
[download]   2.2% of 244.71MiB at 818.62KiB/s ETA 04:59
cappert commented 4 years ago

I hit this error while testing the extractor on Travis, I think it's Dailymotion doing rate-limiting.

If this is the case, should this error be handled by the extractor?

christus02 commented 4 years ago

Hitting the same error with Daily motion even with --ignore-config option

# youtube-dl --ignore-config https://www.dailymotion.com/video/x7swsna --verbose
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--ignore-config', 'https://www.dailymotion.com/video/x7swsna', '--verbose']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.03.08
[debug] Python version 3.6.9 (CPython) - Linux-4.15.0-91-generic-x86_64-with-Ubuntu-18.04-bionic
[debug] exe versions: ffmpeg 3.4.6, ffprobe 3.4.6
[debug] Proxy map: {}
[dailymotion] Downloading Access Token
[dailymotion] x7swsna: Downloading media JSON metadata
[dailymotion] x7swsna: Downloading metadata JSON
[dailymotion] x7swsna: Downloading m3u8 information
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'https://proxy-11.sg1.dailymotion.com/sec(9jVDwBFFl7fgv7P8B5n1Wr6Gw1JEEHpk3ytTnjdj2nDM-3gv6x8od7AP9QhdXN1ID5IyzHwALfswqwbVqnOHsA)/video/895/228/471822598_mp4_h264_aac_fhd.mp4'
ERROR: unable to download video data: HTTP Error 403: Forbidden
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/YoutubeDL.py", line 1926, in process_info
    success = dl(filename, info_dict)
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/YoutubeDL.py", line 1865, in dl
    return fd.download(name, info)
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/downloader/common.py", line 366, in download
    return self.real_download(filename, info_dict)
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/downloader/http.py", line 341, in real_download
    establish_connection()
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/downloader/http.py", line 109, in establish_connection
    ctx.data = self.ydl.urlopen(request)
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/YoutubeDL.py", line 2238, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python3.6/urllib/request.py", line 532, in open
    response = meth(req, response)
  File "/usr/lib/python3.6/urllib/request.py", line 642, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.6/urllib/request.py", line 570, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.6/urllib/request.py", line 650, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
TOlinkGroup commented 3 years ago

same issue! any news?

gheesh commented 2 years ago

Replying to this (correctly) closed issue in case anybody else ends up here like I did: dailymotion has certain IP ranges (such as those from VPS providers, found the hint on #8915) banned, hence the 403. Try running the command elsewhere and it will probably work.