TheHamkerCat 5 jaren geleden
bovenliggende
commit
862b243e6c
3 gewijzigde bestanden met toevoegingen van 11 en 1 verwijderingen
  1. 1 0
      requirements.txt
  2. 1 1
      wbb/modules/ytdl.py
  3. 9 0
      wbb/utils/functions.py

+ 1 - 0
requirements.txt

@@ -23,3 +23,4 @@ telegraph
 uvloop
 youtube_dl
 bs4
+wget

+ 1 - 1
wbb/modules/ytdl.py

@@ -5,7 +5,7 @@ from random import randint
 from pykeyboard import InlineKeyboard
 from pyrogram import filters
 from pyrogram.types import InlineKeyboardButton
-
+import traceback
 from wbb import app, arq
 from wbb.core.decorators.errors import capture_err
 from wbb.utils.formatter import convert_seconds_to_minutes as timeFormat

+ 9 - 0
wbb/utils/functions.py

@@ -34,6 +34,7 @@ from carbonnow import Carbon
 from PIL import Image, ImageDraw, ImageFilter, ImageFont
 
 from wbb.utils import aiodownloader
+from wget import download
 from wbb.utils.fetch import fetch
 
 """
@@ -42,6 +43,14 @@ download file from a given url
 """
 downloader = aiodownloader.Handler()
 
+# Another downloader, but with wget
+
+
+async def download_url(url: str):
+    loop = get_running_loop()
+    file = await loop.run_in_executor(None, download, url)
+    return file
+
 
 def generate_captcha():
     # Generate one letter