Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Atresplayer] Unable to download JSON metadata: HTTP Error 404 #24026

Open
5 tasks done
ghost opened this issue Feb 11, 2020 · 5 comments
Open
5 tasks done

[Atresplayer] Unable to download JSON metadata: HTTP Error 404 #24026

ghost opened this issue Feb 11, 2020 · 5 comments

Comments

@ghost
Copy link

ghost commented Feb 11, 2020

Checklist

  • I'm reporting a broken site support
  • I've verified that I'm running youtube-dl version 2020.01.24
  • 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 issues including closed ones

Verbose log

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['https://www.atresplayer.com/lasexta/programas/lo-de-evole/temporada-1/junqueras_5e3d3d0f7ed1a809591305d5/', '-u', 'PRIVATE', '-p', 'PRIVATE', '--verbose']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dl version 2020.01.24
[debug] Python version 3.8.1 (CPython) - Windows-10-10.0.18362-SP0
[debug] exe versions: ffmpeg 4.2.1, ffprobe 4.2.1, phantomjs 2.1.1
[debug] Proxy map: {}
[AtresPlayer] Downloading login page
[AtresPlayer] Logging in
[AtresPlayer] Following Target URL
[AtresPlayer] 5e3d3d0f7ed1a809591305d5: Downloading JSON metadata
ERROR: Unable to download JSON metadata: HTTP Error 404: Not Found (caused by <HTTPError 404: 'Not Found'>); 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.
  File "c:\users\joser\appdata\local\programs\python\python38-32\lib\site-packages\youtube_dl\extractor\common.py", line 627, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "c:\users\joser\appdata\local\programs\python\python38-32\lib\site-packages\youtube_dl\YoutubeDL.py", line 2237, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "c:\users\joser\appdata\local\programs\python\python38-32\lib\urllib\request.py", line 531, in open
    response = meth(req, response)
  File "c:\users\joser\appdata\local\programs\python\python38-32\lib\urllib\request.py", line 640, in http_response
    response = self.parent.error(
  File "c:\users\joser\appdata\local\programs\python\python38-32\lib\urllib\request.py", line 569, in error
    return self._call_chain(*args)
  File "c:\users\joser\appdata\local\programs\python\python38-32\lib\urllib\request.py", line 502, in _call_chain
    result = func(*args)
  File "c:\users\joser\appdata\local\programs\python\python38-32\lib\urllib\request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)

Description

The plugin has stopped working for all resources. The api seems to have not changed.
Edit:
The new json data endpoint is https://api.atresplayer.com/player/v1/episode/5e3d3d0f7ed1a809591305d5

@ghost
Copy link
Author

ghost commented Feb 12, 2020

Apparently there are more changes.
Atresplayer now distinguishes between two types of videos: episodes and videos.

  • Episodes
    • Episodes
  • Videos
    • Videos
    • Clips

First you have to know if a link is an episode or a video. The html source gives you the answer. The first script tag contains a json with the content type:
"@type":"TVEpisode"

<script type="application/ld+json">{"@context":"http:\u002F\u002Fschema.org","@type":"TVEpisode","@id":"https:\u002F\u002Fwww.atresplayer.com\u002Flasexta\u002Fprogramas\u002Flo-  ........................... </script>

or
"@type":"VideoObject"

<script type="application/ld+json">{"@context":"http:\u002F\u002Fschema.org","@type":"VideoObject","name":"ARUSITYS - Alfonso Arús llega a las mañanas de laSexta: ....................... </script>

Now you can make a request to get one of these two endpoints depending on the type of content:
https://api.atresplayer.com/player/v1/episode/<vod_id>
https://api.atresplayer.com/player/v1/video/<vod_id>

@jEsuSdA
Copy link

jEsuSdA commented Apr 13, 2020

@josergdev Thank you very much!! thanks!!!!

@elmimmo
Copy link

elmimmo commented Apr 1, 2021

Now you can make a request to get one of these two endpoints depending on the type of content:
https://api.atresplayer.com/player/v1/episode/<vod_id>
https://api.atresplayer.com/player/v1/video/<vod_id>

How should I use this to download videos? Trying to download this video, which according to the first script tag is of "@type":"TVEpisode", I tried:

youtube-dl https://api.atresplayer.com/player/v1/episode/60630fd47ed1a832bd5e5f16

which returns:

[generic] 60630fd47ed1a832bd5e5f16: Requesting header
WARNING: Could not send HEAD request to https://api.atresplayer.com/player/v1/episode/60630fd47ed1a832bd5e5f16: HTTP Error 405: Method Not Allowed
[generic] 60630fd47ed1a832bd5e5f16: Downloading webpage
ERROR: Unable to download webpage: HTTP Error 403: Forbidden (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

@manuhortet
Copy link

@elmimmo You get a 403: Forbidden, probably you are trying to download a pay-to-watch video. If so you need to identify yourself to have access to the video.

Login using your browser, get the cookie and pass it as a .txt to the youtube-dl command, something like: youtube-dl --cookies <PATH_TO_COOKIES.TXT> <VIDEO_URL>

@elmimmo
Copy link

elmimmo commented Apr 2, 2021

probably you are trying to download a pay-to-watch video.

The video (linked above) is watchable on its website by anyone, without any need to be signed in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants