mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-10-02 15:21:23 +02:00
Compare commits
No commits in common. "fefbf45f3e2ba1b4a3de63c11b7901a479cd3cf0" and "69f4fdee0b0fc83d77f1dfa0b2ef5c2cadc67222" have entirely different histories.
fefbf45f3e
...
69f4fdee0b
|
@ -1,7 +1,6 @@
|
|||
import base64
|
||||
import random
|
||||
import urllib.parse
|
||||
import re
|
||||
|
||||
from .common import InfoExtractor
|
||||
from ..utils import (
|
||||
|
@ -34,8 +33,6 @@ class RadikoBaseIE(InfoExtractor):
|
|||
_HOSTS_FOR_LIVE = (
|
||||
'https://c-radiko.smartstream.ne.jp',
|
||||
)
|
||||
# performer separtor character (include Japanese charset)
|
||||
_PERFORMER_SPLIT_RE = "[//、 ,,]"
|
||||
|
||||
def _negotiate_token(self):
|
||||
_, auth1_handle = self._download_webpage_handle(
|
||||
|
@ -162,9 +159,6 @@ class RadikoBaseIE(InfoExtractor):
|
|||
|
||||
return formats
|
||||
|
||||
def _extract_performers(self, prog):
|
||||
return [x.strip() for x in try_call(lambda: re.split(self._PERFORMER_SPLIT_RE, prog.find('pfm').text))]
|
||||
|
||||
|
||||
class RadikoIE(RadikoBaseIE):
|
||||
_VALID_URL = r'https?://(?:www\.)?radiko\.jp/#!/ts/(?P<station>[A-Z0-9-]+)/(?P<id>\d+)'
|
||||
|
@ -192,12 +186,12 @@ class RadikoIE(RadikoBaseIE):
|
|||
return {
|
||||
'id': video_id,
|
||||
'title': try_call(lambda: prog.find('title').text),
|
||||
'artists': self._extract_performers(prog),
|
||||
'artist': try_call(lambda: prog.find('pfm').text),
|
||||
'description': clean_html(try_call(lambda: prog.find('info').text)),
|
||||
'uploader': try_call(lambda: station_program.find('.//name').text),
|
||||
'uploader_id': station,
|
||||
'timestamp': vid_int,
|
||||
'duration': try_call(lambda: unified_timestamp(radio_end, False) - unified_timestamp(radio_begin, False)),
|
||||
'duration': (unified_timestamp(radio_end, False) - unified_timestamp(radio_begin, False)),
|
||||
'is_live': True,
|
||||
'formats': self._extract_formats(
|
||||
video_id=video_id, station=station, is_onair=False,
|
||||
|
@ -242,7 +236,7 @@ class RadikoRadioIE(RadikoBaseIE):
|
|||
title = prog.find('title').text
|
||||
description = clean_html(prog.find('info').text)
|
||||
station_name = station_program.find('.//name').text
|
||||
performers = self._extract_performers(prog)
|
||||
performer = prog.find('pfm').text
|
||||
|
||||
formats = self._extract_formats(
|
||||
video_id=station, station=station, is_onair=True,
|
||||
|
@ -252,7 +246,7 @@ class RadikoRadioIE(RadikoBaseIE):
|
|||
return {
|
||||
'id': station,
|
||||
'title': title,
|
||||
'artists': performers,
|
||||
'artist': performer,
|
||||
'description': description,
|
||||
'uploader': station_name,
|
||||
'uploader_id': station,
|
||||
|
|
Loading…
Reference in New Issue
Block a user