mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-09-30 06:11:27 +02:00
Compare commits
No commits in common. "d4d4c1a3a5f04b4a66fc47874f4b2ff7b58af580" and "c14055c09e1921548e57462fbb2b30dbe32ef8eb" have entirely different histories.
d4d4c1a3a5
...
c14055c09e
|
@ -787,7 +787,7 @@ from .iheart import (
|
||||||
IHeartRadioIE,
|
IHeartRadioIE,
|
||||||
IHeartRadioPodcastIE,
|
IHeartRadioPodcastIE,
|
||||||
)
|
)
|
||||||
from .ilpost import IlPostIE
|
from .ilpost import IlPostExtractorIE
|
||||||
from .iltalehti import IltalehtiIE
|
from .iltalehti import IltalehtiIE
|
||||||
from .imdb import (
|
from .imdb import (
|
||||||
ImdbIE,
|
ImdbIE,
|
||||||
|
|
|
@ -1,18 +1,12 @@
|
||||||
import functools
|
import functools
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import (
|
from ..utils import ExtractorError, float_or_none, int_or_none, url_or_none, urlencode_postdata
|
||||||
ExtractorError,
|
|
||||||
float_or_none,
|
|
||||||
int_or_none,
|
|
||||||
url_or_none,
|
|
||||||
urlencode_postdata,
|
|
||||||
)
|
|
||||||
from ..utils.traversal import traverse_obj
|
from ..utils.traversal import traverse_obj
|
||||||
|
|
||||||
|
|
||||||
class IlPostIE(InfoExtractor):
|
class IlPostExtractorIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(?:www\.)?ilpost\.it/episodes/(?P<id>[^/?#]+)'
|
_VALID_URL = r'https?://(?:www\.)?ilpost\.it/episodes/(?P<id>[^/?]+).*'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'https://www.ilpost.it/episodes/1-avis-akvasas-ka/',
|
'url': 'https://www.ilpost.it/episodes/1-avis-akvasas-ka/',
|
||||||
'md5': '43649f002d85e1c2f319bb478d479c40',
|
'md5': '43649f002d85e1c2f319bb478d479c40',
|
||||||
|
@ -32,29 +26,27 @@ class IlPostIE(InfoExtractor):
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
display_id = self._match_id(url)
|
podcast_display_id = self._match_id(url)
|
||||||
webpage = self._download_webpage(url, display_id)
|
webpage = self._download_webpage(url, podcast_display_id)
|
||||||
|
|
||||||
endpoint_metadata = self._search_json(
|
endpoint_metadata = self._search_json(
|
||||||
r'var\s+ilpostpodcast\s*=', webpage, 'metadata', display_id)
|
r'var\s+ilpostpodcast\s*=', webpage, 'metadata', podcast_display_id)
|
||||||
episode_id = endpoint_metadata['post_id']
|
episode_id = endpoint_metadata['post_id']
|
||||||
podcast_id = endpoint_metadata['podcast_id']
|
podcast_id = endpoint_metadata['podcast_id']
|
||||||
podcast_metadata = self._download_json(
|
podcast_metadata = self._download_json(
|
||||||
endpoint_metadata['ajax_url'], display_id, data=urlencode_postdata({
|
endpoint_metadata['ajax_url'], podcast_display_id, data=urlencode_postdata({
|
||||||
'action': 'checkpodcast',
|
'action': 'checkpodcast',
|
||||||
'cookie': endpoint_metadata['cookie'],
|
'cookie': endpoint_metadata['cookie'],
|
||||||
'post_id': episode_id,
|
'post_id': episode_id,
|
||||||
'podcast_id': podcast_id,
|
'podcast_id': podcast_id,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
episode = traverse_obj(podcast_metadata, (
|
episode = traverse_obj(podcast_metadata, (
|
||||||
'data', 'postcastList', lambda _, v: str(v['id']) == episode_id, {dict}), get_all=False)
|
'data', 'postcastList', lambda _, v: str(v['id']) == episode_id, {dict}), get_all=False)
|
||||||
if not episode:
|
if not episode:
|
||||||
raise ExtractorError('Episode could not be extracted')
|
raise ExtractorError('Episode could not be extracted')
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': episode_id,
|
'id': episode_id,
|
||||||
'display_id': display_id,
|
'display_id': podcast_display_id,
|
||||||
'series_id': podcast_id,
|
'series_id': podcast_id,
|
||||||
'vcodec': 'none',
|
'vcodec': 'none',
|
||||||
**traverse_obj(episode, {
|
**traverse_obj(episode, {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user