-
Notifications
You must be signed in to change notification settings - Fork 10k
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
[rtvs] Add new extractor #15187
[rtvs] Add new extractor #15187
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# coding: utf-8 | ||
from __future__ import unicode_literals | ||
|
||
from .common import InfoExtractor | ||
|
||
|
||
class RtvsExtractorIE(InfoExtractor): | ||
_VALID_URL = r'https?://(?:www\.)?rtvs\.sk/.*/archiv/[0-9]*/(?P<id>[0-9]+)' | ||
_TESTS = [{ | ||
# radio archive | ||
'url': 'http://www.rtvs.sk/radio/archiv/11224/414872', | ||
'md5': '134d5d6debdeddf8a5d761cbc9edacb8', | ||
'info_dict': { | ||
'id': '414872', | ||
'ext': 'mp3', | ||
'title': 'Ostrov pokladov 1 časť.mp3' | ||
} | ||
}, { | ||
# tv archive | ||
'url': 'http://www.rtvs.sk/televizia/archiv/8249/63118', | ||
'md5': '85e2c55cf988403b70cac24f5c086dc6', | ||
'info_dict': { | ||
'id': '63118', | ||
'ext': 'mp4', | ||
'title': 'Amaro Džives - Náš deň', | ||
'description': 'Galavečer pri príležitosti Medzinárodného dňa Rómov.' | ||
} | ||
}] | ||
|
||
def _real_extract(self, url): | ||
video_id = self._match_id(url) | ||
webpage = self._download_webpage(url, video_id) | ||
|
||
playlist_url = self._search_regex(r'"playlist": "(https?:.*)&', webpage, 'playlist_url') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should capture behind quotes. Non greedy. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you elaborate or post the changed regex, please? For example the line is: |
||
self.to_screen("%s: Playlist URL: %s" % (video_id, playlist_url)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. |
||
playlist = self._download_json(playlist_url, video_id, "Downloading playlist") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Single quotes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. |
||
jwplayer_data = playlist[0] | ||
return self._parse_jwplayer_data(jwplayer_data, video_id=video_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
Extractor
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.