From a48cfe83f0d18d65d3ee539012173631f1724846 Mon Sep 17 00:00:00 2001 From: SanujaNS Date: Sun, 17 Nov 2024 22:51:21 +0530 Subject: [PATCH 1/2] Improve `extract_code_from_instagram_url` function --- ytdlbot/utils.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/ytdlbot/utils.py b/ytdlbot/utils.py index 4ec317d4..59d5c93e 100644 --- a/ytdlbot/utils.py +++ b/ytdlbot/utils.py @@ -247,12 +247,28 @@ def parse_cookie_file(cookiefile): def extract_code_from_instagram_url(url): # Regular expression patterns - patterns = [r"/p/([a-zA-Z0-9_-]+)/", r"/reel/([a-zA-Z0-9_-]+)/"] # Posts # Reels + patterns = [ + # Instagram stories highlights + r'/stories/highlights/([a-zA-Z0-9_-]+)/', + # Posts + r"/p/([a-zA-Z0-9_-]+)/", + # Reels + r"/reel/([a-zA-Z0-9_-]+)/", + # TV + r"/tv/([a-zA-Z0-9_-]+)/", + # Threads post (both with @username and without) + r'(?:https?://)?(?:www\.)?(?:threads\.net)(?:/[@\w.]+)?(?:/post)?/([\w-]+)(?:/?\?.*)?$' + ] for pattern in patterns: match = re.search(pattern, url) if match: - return match.group(1) + if pattern == patterns[0]: # Check if it's the stories highlights pattern + # Return the URL as it is + return url + else: + # Return the code part (first group) + return match.group(1) return None From 6a529b83ce991bf4acf4c2e900a4ed8ffe644460 Mon Sep 17 00:00:00 2001 From: SanujaNS Date: Fri, 22 Nov 2024 22:27:54 +0530 Subject: [PATCH 2/2] =?UTF-8?q?Bump=20yt-dlp=20from=202024.11.04=20to=2020?= =?UTF-8?q?24.11.18=20(Tested=20=E2=9C=85)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a5d53624..77ee94a2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ git+https://github.com/KurimuzonAkuma/pyrogram tgcrypto==1.2.5 -yt-dlp[default]==2024.11.04 +yt-dlp[default]==2024.11.18 APScheduler==3.10.4 beautifultable==1.1.0 ffmpeg-python==0.2.0