From a5016aff9c9d265d7e0e52653bf40e68c0c815e4 Mon Sep 17 00:00:00 2001 From: DentorDev <92227212+Dentordev@users.noreply.github.com> Date: Thu, 20 Mar 2025 13:24:59 -0500 Subject: [PATCH 1/7] Create speedrun.py --- yt_dlp/extractor/speedrun.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 yt_dlp/extractor/speedrun.py diff --git a/yt_dlp/extractor/speedrun.py b/yt_dlp/extractor/speedrun.py new file mode 100644 index 000000000..9f194c7c6 --- /dev/null +++ b/yt_dlp/extractor/speedrun.py @@ -0,0 +1,24 @@ +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[^?/#]+)' + + _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'