Skip to content
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

[ie/Turbo] Fix turbo extractor #8927

Merged
merged 11 commits into from Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion supportedsites.md
Expand Up @@ -1471,7 +1471,6 @@
- **TuneInPodcast**
- **TuneInPodcastEpisode**
- **TuneInStation**
- **Turbo**
- **tv.dfb.de**
- **TV2**
- **TV2Article**
Expand Down Expand Up @@ -1601,6 +1600,7 @@
- **ViMP:Playlist**
- **Vine**
- **vine:user**
- **viously**
seproDev marked this conversation as resolved.
Show resolved Hide resolved
- **Viqeo**
- **Viu**
- **viu:ott**: [*viu*](## "netrc machine")
Expand Down
2 changes: 1 addition & 1 deletion yt_dlp/extractor/_extractors.py
Expand Up @@ -2019,7 +2019,6 @@
TuneInPodcastEpisodeIE,
TuneInShortenerIE,
)
from .turbo import TurboIE
from .tv2 import (
TV2IE,
TV2ArticleIE,
Expand Down Expand Up @@ -2223,6 +2222,7 @@
VikiIE,
VikiChannelIE,
)
from .viously import ViouslyIE
from .viqeo import ViqeoIE
from .viu import (
ViuIE,
Expand Down
64 changes: 0 additions & 64 deletions yt_dlp/extractor/turbo.py

This file was deleted.

38 changes: 38 additions & 0 deletions yt_dlp/extractor/viously.py
@@ -0,0 +1,38 @@
from .common import InfoExtractor
from ..utils import (
get_element_html_by_class,
get_elements_html_by_class,
)
nbr23 marked this conversation as resolved.
Show resolved Hide resolved


class ViouslyIE(InfoExtractor):
_VALID_URL = False
_API_URL = 'https://www.viously.com/video/hls/{0:}/index.m3u8'
seproDev marked this conversation as resolved.
Show resolved Hide resolved
_WEBPAGE_TESTS = [{
'url': 'http://www.turbo.fr/videos-voiture/454443-turbo-du-07-09-2014-renault-twingo-3-bentley-continental-gt-speed-ces-guide-achat-dacia.html',
'md5': '37a6c3381599381ff53a7e1e0575c0bc',
'info_dict': {
'id': 'F_xQzS2jwb3',
'ext': 'mp4',
'title': 'Turbo du 07/09/2014 : Renault Twingo 3, Bentley Continental GT Speed, CES, Guide Achat Dacia...',
'description': 'Turbo du 07/09/2014 : Renault Twingo 3, Bentley Continental GT Speed, CES, Guide Achat Dacia...',
'age_limit': 0,
'upload_date': str,
'timestamp': float,
nbr23 marked this conversation as resolved.
Show resolved Hide resolved
}
}]

def _extract_from_webpage(self, url, webpage):
has_vously_player = get_element_html_by_class('viously-player', webpage) or get_element_html_by_class('vsly-player', webpage)
if not has_vously_player:
return
viously_players = get_elements_html_by_class('viously-player', webpage) + get_elements_html_by_class('vsly-player', webpage)
nbr23 marked this conversation as resolved.
Show resolved Hide resolved
for viously_player in viously_players:
video_id = self._html_search_regex(r'id="([-_\w]+)"', viously_player, 'video_id')
title = self._html_extract_title(webpage)
yield {
'id': video_id,
'title': title,
'description': title,
'formats': self._extract_m3u8_formats(self._API_URL.format(video_id), video_id),
}
seproDev marked this conversation as resolved.
Show resolved Hide resolved