Skip to content

Commit

Permalink
fix: custom_thumbnail
Browse files Browse the repository at this point in the history
  • Loading branch information
X-Gorn committed Jun 9, 2024
1 parent 1a0412c commit f91d2a1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Bot/functions/dl_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ async def ddl_call_back(bot: Client, update: CallbackQuery):
if client.guess_mime_type(download_directory) in ffmpeg_supported_video_mimetypes:
await run_cmd('ffmpeg -ss {} -i "{}" -vframes 1 "{}"'.format(random.randint(0, duration), download_directory, thumb_image_path))
# get the correct width, height, and duration for videos greater than 10MB
if os.path.exists(thumb_image_path):
if os.path.exists(thumb_image_path) and not client.custom_thumbnail.get(update.from_user.id):
width = 0
height = 0
metadata = extractMetadata(createParser(thumb_image_path))
Expand Down
2 changes: 1 addition & 1 deletion Bot/functions/youtube_dl_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ async def youtube_dl_call_back(bot: Client, update: CallbackQuery):
if client.guess_mime_type(download_directory) in ffmpeg_supported_video_mimetypes:
await run_cmd('ffmpeg -ss {} -i "{}" -vframes 1 "{}"'.format(random.randint(0, duration), download_directory, thumb_image_path))
# get the correct width, height, and duration for videos greater than 10MB
if os.path.exists(thumb_image_path):
if os.path.exists(thumb_image_path) and not client.custom_thumbnail.get(update.from_user.id):
width = 0
height = 0
metadata = extractMetadata(createParser(thumb_image_path))
Expand Down
2 changes: 1 addition & 1 deletion Bot/plugins/echo.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ async def echo_http(bot: Client, update: Message):
if response_json["thumbnail"] is not None:
thumbnail = response_json["thumbnail"]
thumbnail_image = response_json["thumbnail"]
if not client.custom_thumbnail:
if not client.custom_thumbnail.get(update.from_user.id):
thumb_image_path = client.config.DOWNLOAD_LOCATION + \
"/" + str(update.from_user.id) + ".webp"
await download_coroutine(
Expand Down
6 changes: 3 additions & 3 deletions Bot/translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

class Translation(object):
START_TEXT = "Hi {},\nI'm X-URL-Uploader!\nYou can upload HTTP/HTTPS direct link using this bot!\n\n/help for more details!"
FORMAT_SELECTION = "Select the desired format: <a href='{}'>file size might be approximate</a> \nIf you want to set custom thumbnail, send photo before or quickly after tapping on any of the below buttons.\nYou can use /deletethumbnail to delete the auto-generated thumbnail."
FORMAT_SELECTION = "Select the desired format: <a href='{}'>file size might be approximate</a>"
SET_CUSTOM_USERNAME_PASSWORD = "If you want to download premium videos, provide in the following format:\nURL | filename | username | password"
DOWNLOAD_START = "Now Downloading.."
UPLOAD_START = "Now Uploading.."
DOWNLOAD_START = "Downloading..."
UPLOAD_START = "Uploading..."
RCHD_TG_API_LIMIT = "Downloaded in {} seconds.\nDetected File Size: {}\nSorry. But, I cannot upload files greater than 2GB due to Telegram API limitations."
AFTER_SUCCESSFUL_UPLOAD_MSG = "Thanks for using @xurluploaderbot)"
AFTER_SUCCESSFUL_UPLOAD_MSG_WITH_TS = "Downloaded in {} seconds.\nUploaded in {} seconds.\n\n@xurluploaderbot"
Expand Down

0 comments on commit f91d2a1

Please sign in to comment.