From 0acaf194b9cc9d5781ce81c006e4e5ab5022b9f1 Mon Sep 17 00:00:00 2001 From: JitishxD Date: Wed, 5 Aug 2026 19:31:53 +0530 Subject: [PATCH] fix: prepend playlist index to playlist outtmpl for correct upload order - Files downloaded from playlists were named without any playlist index, causing natsorted uploads to follow alphabetical title order instead of the actual playlist order. Prepend %(playlist_index)03d to both default and thumbnail outtmpl templates so filenames sort in playlist sequence. --- .../mirror_leech_utils/download_utils/yt_dlp_download.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/helper/mirror_leech_utils/download_utils/yt_dlp_download.py b/bot/helper/mirror_leech_utils/download_utils/yt_dlp_download.py index a231402c728..d740231a796 100644 --- a/bot/helper/mirror_leech_utils/download_utils/yt_dlp_download.py +++ b/bot/helper/mirror_leech_utils/download_utils/yt_dlp_download.py @@ -252,8 +252,8 @@ async def add_download(self, path, qual, playlist, options): start_path = path if self.keep_thumb else f"{path}/yt-dlp-thumb" if self.is_playlist: self.opts["outtmpl"] = { - "default": f"{path}/{self._listener.name}/%(title,fulltitle,alt_title)s%(season_number& |)s%(season_number&S|)s%(season_number|)02d%(episode_number&E|)s%(episode_number|)02d%(height& |)s%(height|)s%(height&p|)s%(fps|)s%(fps&fps|)s%(tbr& |)s%(tbr|)d.%(ext)s", - "thumbnail": f"{start_path}/%(title,fulltitle,alt_title)s%(season_number& |)s%(season_number&S|)s%(season_number|)02d%(episode_number&E|)s%(episode_number|)02d%(height& |)s%(height|)s%(height&p|)s%(fps|)s%(fps&fps|)s%(tbr& |)s%(tbr|)d.%(ext)s", + "default": f"{path}/{self._listener.name}/%(playlist_index)03d - %(title,fulltitle,alt_title)s%(season_number& |)s%(season_number&S|)s%(season_number|)02d%(episode_number&E|)s%(episode_number|)02d%(height& |)s%(height|)s%(height&p|)s%(fps|)s%(fps&fps|)s%(tbr& |)s%(tbr|)d.%(ext)s", + "thumbnail": f"{start_path}/%(playlist_index)03d - %(title,fulltitle,alt_title)s%(season_number& |)s%(season_number&S|)s%(season_number|)02d%(episode_number&E|)s%(episode_number|)02d%(height& |)s%(height|)s%(height&p|)s%(fps|)s%(fps&fps|)s%(tbr& |)s%(tbr|)d.%(ext)s", } elif "download_ranges" in options: self.opts["outtmpl"] = {