mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2025-01-07 13:47:54 +01:00
[narando] Add description support and improve code to meet youtube-dl's standards
This commit is contained in:
parent
2190b6aaa1
commit
a729d43d9e
@ -14,6 +14,7 @@ class NarandoIE(InfoExtractor):
|
||||
'ext': 'mp3',
|
||||
'title': 'An ihrem Selbstlob erkennt man sie',
|
||||
'url': 'https://static.narando.com/sounds/10492/original.mp3',
|
||||
'description': u'omnisophie.com: Kaum eine Woche vergeht, dass nicht jemand mir gegenüber seine Mathematik-Unkenntnisse tränenlos beweint. „In Mathe war ich niemals gut.“ Diese Leute sagen mir das wohl, weil ich Mathematiker bin, und da gehört so ein fröhliches „Understatement“ zum Small Talk. So wie wenn ich selbst bedauernd-entschuldigend auf meine grauen Haare zeige. Ich kann eben auch nicht alles bieten... „Mathe kann ich nicht“, „Ich habe kein Internet“ oder „Ich will auch bewusst nicht alles können“ wird fast wie Eigenlob vorgetragen.',
|
||||
# TODO more properties, either as:
|
||||
# * A value
|
||||
# * MD5 checksum; start the string with md5:
|
||||
@ -27,16 +28,18 @@ class NarandoIE(InfoExtractor):
|
||||
# webpage = self._download_webpage(url,"?")
|
||||
# print(url)
|
||||
# print('https://narando.com/articles/'+video_id)
|
||||
webpage = self._download_webpage('https://narando.com/articles/'+video_id+"?", video_id)#for some reason, this absolutely refused to work, so I'm negating the video_id and just adding it directly
|
||||
webpage = self._download_webpage('https://narando.com/articles/'+video_id, video_id)
|
||||
# TODO more code goes here, for example ...
|
||||
title = self._html_search_regex(r'<h1 class="visible-xs h3">(.+?)</h1>', webpage, 'title')
|
||||
# print(title)
|
||||
player_id = self._html_search_regex(" ".join(r'[\n\r].*https:\/\/narando.com\/r\/\s*([^"]*)'.split()), webpage, 'player_id')
|
||||
player_page = self._download_webpage('https://narando.com/widget?r='+player_id+'&',player_id)#same as above
|
||||
download_url = self._html_search_regex(r'.<div class="stream_url hide">\s*([^?]*)', player_page, 'mp3_ddl')
|
||||
player_page = self._download_webpage('https://narando.com/widget?r='+player_id, player_id)
|
||||
download_url = self._html_search_regex(r'.<div class="stream_url hide">\s*([^?]*)', player_page, 'download_url')
|
||||
description = self._html_search_regex(ur'<meta content="(.+?)" property="og:description" />', webpage, 'description')
|
||||
return {
|
||||
'id': video_id,
|
||||
'title': title,
|
||||
'url': download_url,
|
||||
'description': description,
|
||||
# TODO more properties (see youtube_dl/extractor/common.py)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user