1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-06-27 17:08:32 +00:00
This commit is contained in:
DentorDev 2025-06-26 06:21:32 +09:00 committed by GitHub
commit 32c5f69dd9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 26 additions and 0 deletions

View File

@ -1950,6 +1950,7 @@
SpankBangIE,
SpankBangPlaylistIE,
)
from .speedrun import SpeedRunIE
from .spiegel import SpiegelIE
from .spike import (
BellatorIE,

View File

@ -0,0 +1,25 @@
from .common import InfoExtractor
# Speedrun.com has the ability to host twitch embeds as well which is why this
# script was needed.
class SpeedRunIE(InfoExtractor):
IE_NAME = 'speedrun'
_VALID_URL = r'https?://(?:www\.)?speedrun\.com/[^/?#]+/runs/(?P<id>[^?/#]+)'
_TESTS = [{
'url': 'https://www.speedrun.com/smg1/runs/yvnjr9om',
'only_matching': True,
}, {
'url': 'https://www.speedrun.com/pm64/runs/y96x462y',
'only_matching': True,
}]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
embed_url = self._search_regex(
r'<iframe [^>]*class="[^"]*block[^"]+" [^>]*src="([^"]+)', webpage, 'embed url')
return self.url_result(embed_url)