taslim19 commited on
Commit
79c6ac3
·
1 Parent(s): b8b8b54

fix: replace get_thumb with gen_thumb in all relevant files to resolve ImportError

Browse files
DragMusic/core/call.py CHANGED
@@ -38,7 +38,7 @@ from DragMusic.utils.exceptions import AssistantErr
38
  from DragMusic.utils.formatters import check_duration, seconds_to_min, speed_converter
39
  from DragMusic.utils.inline.play import stream_markup
40
  from DragMusic.utils.stream.autoclear import auto_clean
41
- from DragMusic.utils.thumbnails import get_thumb
42
  from strings import get_string
43
 
44
  autoend = {}
@@ -417,7 +417,7 @@ class Call(PyTgCalls):
417
  original_chat_id,
418
  text=_["call_6"],
419
  )
420
- img = await get_thumb(videoid)
421
  button = stream_markup2(_, chat_id)
422
  run = await app.send_photo(
423
  chat_id=original_chat_id,
@@ -464,7 +464,7 @@ class Call(PyTgCalls):
464
  original_chat_id,
465
  text=_["call_6"],
466
  )
467
- img = await get_thumb(videoid)
468
  button = stream_markup(_, videoid, chat_id)
469
  await mystic.delete()
470
  run = await app.send_photo(
@@ -559,7 +559,7 @@ class Call(PyTgCalls):
559
  db[chat_id][0]["mystic"] = run
560
  db[chat_id][0]["markup"] = "tg"
561
  else:
562
- img = await get_thumb(videoid)
563
  button = stream_markup(_, videoid, chat_id)
564
  run = await app.send_photo(
565
  chat_id=original_chat_id,
 
38
  from DragMusic.utils.formatters import check_duration, seconds_to_min, speed_converter
39
  from DragMusic.utils.inline.play import stream_markup
40
  from DragMusic.utils.stream.autoclear import auto_clean
41
+ from DragMusic.utils.thumbnails import gen_thumb
42
  from strings import get_string
43
 
44
  autoend = {}
 
417
  original_chat_id,
418
  text=_["call_6"],
419
  )
420
+ img = await gen_thumb(videoid)
421
  button = stream_markup2(_, chat_id)
422
  run = await app.send_photo(
423
  chat_id=original_chat_id,
 
464
  original_chat_id,
465
  text=_["call_6"],
466
  )
467
+ img = await gen_thumb(videoid)
468
  button = stream_markup(_, videoid, chat_id)
469
  await mystic.delete()
470
  run = await app.send_photo(
 
559
  db[chat_id][0]["mystic"] = run
560
  db[chat_id][0]["markup"] = "tg"
561
  else:
562
+ img = await gen_thumb(videoid)
563
  button = stream_markup(_, videoid, chat_id)
564
  run = await app.send_photo(
565
  chat_id=original_chat_id,
DragMusic/plugins/admins/callback.py CHANGED
@@ -21,7 +21,7 @@ from DragMusic.utils.decorators.language import languageCB
21
  from DragMusic.utils.formatters import seconds_to_min
22
  from DragMusic.utils.inline import close_markup, stream_markup, stream_markup_timer
23
  from DragMusic.utils.stream.autoclear import auto_clean
24
- from DragMusic.utils.thumbnails import get_thumb
25
  from config import (
26
  BANNED_USERS,
27
  SUPPORT_CHAT,
@@ -227,7 +227,7 @@ async def del_back_playlist(client, CallbackQuery, _):
227
  except:
228
  return await CallbackQuery.message.reply_text(_["call_6"])
229
  button = stream_markup(_, chat_id)
230
- img = await get_thumb(videoid)
231
  run = await CallbackQuery.message.reply_photo(
232
  photo=img,
233
  caption=_["stream_1"].format(
@@ -263,7 +263,7 @@ async def del_back_playlist(client, CallbackQuery, _):
263
  except:
264
  return await mystic.edit_text(_["call_6"])
265
  button = stream_markup(_, chat_id)
266
- img = await get_thumb(videoid)
267
  run = await CallbackQuery.message.reply_photo(
268
  photo=img,
269
  caption=_["stream_1"].format(
@@ -334,7 +334,7 @@ async def del_back_playlist(client, CallbackQuery, _):
334
  db[chat_id][0]["markup"] = "tg"
335
  else:
336
  button = stream_markup(_, chat_id)
337
- img = await get_thumb(videoid)
338
  run = await CallbackQuery.message.reply_photo(
339
  photo=img,
340
  caption=_["stream_1"].format(
 
21
  from DragMusic.utils.formatters import seconds_to_min
22
  from DragMusic.utils.inline import close_markup, stream_markup, stream_markup_timer
23
  from DragMusic.utils.stream.autoclear import auto_clean
24
+ from DragMusic.utils.thumbnails import gen_thumb
25
  from config import (
26
  BANNED_USERS,
27
  SUPPORT_CHAT,
 
227
  except:
228
  return await CallbackQuery.message.reply_text(_["call_6"])
229
  button = stream_markup(_, chat_id)
230
+ img = await gen_thumb(videoid)
231
  run = await CallbackQuery.message.reply_photo(
232
  photo=img,
233
  caption=_["stream_1"].format(
 
263
  except:
264
  return await mystic.edit_text(_["call_6"])
265
  button = stream_markup(_, chat_id)
266
+ img = await gen_thumb(videoid)
267
  run = await CallbackQuery.message.reply_photo(
268
  photo=img,
269
  caption=_["stream_1"].format(
 
334
  db[chat_id][0]["markup"] = "tg"
335
  else:
336
  button = stream_markup(_, chat_id)
337
+ img = await gen_thumb(videoid)
338
  run = await CallbackQuery.message.reply_photo(
339
  photo=img,
340
  caption=_["stream_1"].format(
DragMusic/plugins/admins/skip.py CHANGED
@@ -9,7 +9,7 @@ from DragMusic.utils.database import get_loop
9
  from DragMusic.utils.decorators import AdminRightsCheck
10
  from DragMusic.utils.inline import close_markup, stream_markup
11
  from DragMusic.utils.stream.autoclear import auto_clean
12
- from DragMusic.utils.thumbnails import get_thumb
13
  from config import BANNED_USERS
14
 
15
 
@@ -115,7 +115,7 @@ async def skip(cli, message: Message, _, chat_id):
115
  except:
116
  return await message.reply_text(_["call_6"])
117
  button = stream_markup(_, chat_id)
118
- img = await get_thumb(videoid)
119
  run = await message.reply_photo(
120
  photo=img,
121
  caption=_["stream_1"].format(
@@ -148,7 +148,7 @@ async def skip(cli, message: Message, _, chat_id):
148
  except:
149
  return await mystic.edit_text(_["call_6"])
150
  button = stream_markup(_, chat_id)
151
- img = await get_thumb(videoid)
152
  run = await message.reply_photo(
153
  photo=img,
154
  caption=_["stream_1"].format(
@@ -217,7 +217,7 @@ async def skip(cli, message: Message, _, chat_id):
217
  db[chat_id][0]["markup"] = "tg"
218
  else:
219
  button = stream_markup(_, chat_id)
220
- img = await get_thumb(videoid)
221
  run = await message.reply_photo(
222
  photo=img,
223
  caption=_["stream_1"].format(
 
9
  from DragMusic.utils.decorators import AdminRightsCheck
10
  from DragMusic.utils.inline import close_markup, stream_markup
11
  from DragMusic.utils.stream.autoclear import auto_clean
12
+ from DragMusic.utils.thumbnails import gen_thumb
13
  from config import BANNED_USERS
14
 
15
 
 
115
  except:
116
  return await message.reply_text(_["call_6"])
117
  button = stream_markup(_, chat_id)
118
+ img = await gen_thumb(videoid)
119
  run = await message.reply_photo(
120
  photo=img,
121
  caption=_["stream_1"].format(
 
148
  except:
149
  return await mystic.edit_text(_["call_6"])
150
  button = stream_markup(_, chat_id)
151
+ img = await gen_thumb(videoid)
152
  run = await message.reply_photo(
153
  photo=img,
154
  caption=_["stream_1"].format(
 
217
  db[chat_id][0]["markup"] = "tg"
218
  else:
219
  button = stream_markup(_, chat_id)
220
+ img = await gen_thumb(videoid)
221
  run = await message.reply_photo(
222
  photo=img,
223
  caption=_["stream_1"].format(
DragMusic/utils/stream/stream.py CHANGED
@@ -13,7 +13,7 @@ from DragMusic.utils.exceptions import AssistantErr
13
  from DragMusic.utils.inline import aq_markup, close_markup, stream_markup
14
  from DragMusic.utils.pastebin import DragBin
15
  from DragMusic.utils.stream.queue import put_queue, put_queue_index
16
- from DragMusic.utils.thumbnails import get_thumb
17
 
18
 
19
  async def stream(
@@ -98,7 +98,7 @@ async def stream(
98
  "video" if video else "audio",
99
  forceplay=forceplay,
100
  )
101
- img = await get_thumb(vidid)
102
  button = stream_markup(_, chat_id)
103
  run = await app.send_photo(
104
  original_chat_id,
@@ -184,7 +184,7 @@ async def stream(
184
  "video" if video else "audio",
185
  forceplay=forceplay,
186
  )
187
- img = await get_thumb(vidid)
188
  button = stream_markup(_, chat_id)
189
  run = await app.send_photo(
190
  original_chat_id,
@@ -352,7 +352,7 @@ async def stream(
352
  "video" if video else "audio",
353
  forceplay=forceplay,
354
  )
355
- img = await get_thumb(vidid)
356
  button = stream_markup(_, chat_id)
357
  run = await app.send_photo(
358
  original_chat_id,
 
13
  from DragMusic.utils.inline import aq_markup, close_markup, stream_markup
14
  from DragMusic.utils.pastebin import DragBin
15
  from DragMusic.utils.stream.queue import put_queue, put_queue_index
16
+ from DragMusic.utils.thumbnails import gen_thumb
17
 
18
 
19
  async def stream(
 
98
  "video" if video else "audio",
99
  forceplay=forceplay,
100
  )
101
+ img = await gen_thumb(vidid)
102
  button = stream_markup(_, chat_id)
103
  run = await app.send_photo(
104
  original_chat_id,
 
184
  "video" if video else "audio",
185
  forceplay=forceplay,
186
  )
187
+ img = await gen_thumb(vidid)
188
  button = stream_markup(_, chat_id)
189
  run = await app.send_photo(
190
  original_chat_id,
 
352
  "video" if video else "audio",
353
  forceplay=forceplay,
354
  )
355
+ img = await gen_thumb(vidid)
356
  button = stream_markup(_, chat_id)
357
  run = await app.send_photo(
358
  original_chat_id,