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

[rai] drm check and fix #27657

Closed
wants to merge 9 commits into from
Closed

[rai] drm check and fix #27657

wants to merge 9 commits into from

Conversation

nixxo
Copy link
Contributor

@nixxo nixxo commented Jan 4, 2021

Before submitting a pull request make sure you have:

In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:

  • I am the original author of this code and I am willing to release it under Unlicense

What is the purpose of your pull request?

  • Bug fix
  • Improvement

Description of your pull request and other information

@dstftw
Copy link
Collaborator

dstftw commented Jan 4, 2021

Read coding conventions.

youtube_dl/extractor/rai.py Outdated Show resolved Hide resolved
youtube_dl/extractor/rai.py Outdated Show resolved Hide resolved
@nixxo nixxo mentioned this pull request Jan 5, 2021
7 tasks
@nixxo nixxo requested a review from dstftw January 5, 2021 18:24
@dirkf
Copy link
Contributor

dirkf commented Apr 5, 2022

Is this still relevant?

@nixxo
Copy link
Contributor Author

nixxo commented Apr 5, 2022

no, it can be closed.

@dirkf
Copy link
Contributor

dirkf commented Apr 5, 2022

Thx

@dirkf dirkf closed this Apr 5, 2022
@nixxo
Copy link
Contributor Author

nixxo commented Apr 5, 2022

@dirkf sorry, my mistake.
I thought I was looking at yt-dlp PRs and not the original youtube-dl. This PR should be re-opened and merged.

Sorry again.

@dirkf
Copy link
Contributor

dirkf commented Apr 5, 2022

The linked issue was marked as fixed in fcd90d2 (your #27673) but Sergey didn't merge this change.

I distilled it to this 9e5ca66:

--- a/youtube_dl/extractor/rai.py
+++ b/youtube_dl/extractor/rai.py
@@ -158,6 +158,10 @@ class RaiPlayIE(RaiBaseIE):
         # subtitles at 'subtitlesArray' key (see #27698)
         'url': 'https://www.raiplay.it/video/2020/12/Report---04-01-2021-2e90f1de-8eee-4de4-ac0e-78d21db5b600.html',
         'only_matching': True,
+    }, {
+        # DRM protected
+        'url': 'https://www.raiplay.it/video/2020/09/Lo-straordinario-mondo-di-Zoey-S1E1-Lo-straordinario-potere-di-Zoey-ed493918-1d32-44b7-8454-862e473d00ff.html',
+        'only_matching': True,
     }]
 
     def _real_extract(self, url):
@@ -166,6 +170,13 @@ class RaiPlayIE(RaiBaseIE):
         media = self._download_json(
             base + '.json', video_id, 'Downloading video JSON')
 
+        if try_get(
+                media,
+                (lambda x: x['rights_management']['rights']['drm'],
+                 lambda x: x['program_info']['rights_management']['rights']['drm']),
+                dict):
+             raise ExtractorError('This video is DRM protected.', expected=True)
+
         title = media['name']
 
         video = media['video']

@nixxo
Copy link
Contributor Author

nixxo commented Apr 5, 2022

dstftw asked me to split the PR in 2 because it fixed two different problems (see here: #27657 (comment)) and so I did (#27657 #27673) but then he only merged one leaving this one un-merged.

dirkf pushed a commit to dirkf/youtube-dl that referenced this pull request Apr 5, 2022
dirkf pushed a commit to dirkf/youtube-dl that referenced this pull request Apr 5, 2022
dirkf pushed a commit that referenced this pull request Apr 5, 2022
github-actions bot added a commit to hellopony/youtube-dl that referenced this pull request Apr 5, 2022
* https://github.com/ytdl-org/youtube-dl:
  [RAI] Fix extraction of http formats
  [RAI] Extend formats with direct http mp4 link (PR ytdl-org#27990)
  [RAI] Added checks for DRM protected content (PR ytdl-org#27657)
gaming-hacker added a commit to gaming-hacker/youtube-dl that referenced this pull request Apr 12, 2022
* commit '871645a4a4a0e12ec8f7bf78a3ad7bf75838ee5c':
  [RAI] Fix extraction of http formats
  [RAI] Extend formats with direct http mp4 link (PR ytdl-org#27990)
  [RAI] Added checks for DRM protected content (PR ytdl-org#27657)
dirkf pushed a commit to dirkf/youtube-dl that referenced this pull request Jun 27, 2022
alxlive pushed a commit to alxlive/youtube-dl that referenced this pull request Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants