mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-03-09 12:50:23 -05:00
Merge c372c1bd7c
into 05c8023a27
This commit is contained in:
commit
ebeea99982
1 changed files with 17 additions and 0 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
import datetime as dt
|
||||||
|
import re
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
ExtractorError,
|
ExtractorError,
|
||||||
|
@ -144,6 +147,18 @@ def _real_extract(self, url):
|
||||||
provider = str_or_none(episode_content.get('productionProviderName'))
|
provider = str_or_none(episode_content.get('productionProviderName'))
|
||||||
onair_label = str_or_none(episode_content.get('broadcastDateLabel'))
|
onair_label = str_or_none(episode_content.get('broadcastDateLabel'))
|
||||||
|
|
||||||
|
if mobj := re.search(r'(\d+)月(\d+)日', onair_label):
|
||||||
|
year = dt.datetime.now(dt.timezone(dt.timedelta(hours=9))).year
|
||||||
|
month, day = map(int, mobj.groups())
|
||||||
|
release_year = year
|
||||||
|
release_date = dt.datetime(year, month, day).strftime('%Y%m%d')
|
||||||
|
elif mobj := re.search(r'(\d{4})年放送', onair_label):
|
||||||
|
release_year = int(mobj.group(1))
|
||||||
|
release_date = None
|
||||||
|
else:
|
||||||
|
release_year = None
|
||||||
|
release_date = None
|
||||||
|
|
||||||
thumbnails = [
|
thumbnails = [
|
||||||
{
|
{
|
||||||
'id': quality,
|
'id': quality,
|
||||||
|
@ -174,4 +189,6 @@ def _real_extract(self, url):
|
||||||
'url': smuggle_url(
|
'url': smuggle_url(
|
||||||
self.BRIGHTCOVE_URL_TEMPLATE % (p_id, r_id), {'geo_countries': ['JP']}),
|
self.BRIGHTCOVE_URL_TEMPLATE % (p_id, r_id), {'geo_countries': ['JP']}),
|
||||||
'ie_key': 'BrightcoveNew',
|
'ie_key': 'BrightcoveNew',
|
||||||
|
'release_year': release_year,
|
||||||
|
'release_date': release_date,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue