parent
acdc2aa8b7
commit
0c50bcf8ee
|
|
@ -1,7 +1,6 @@
|
||||||
from bot import aria2, download_dict_lock, STOP_DUPLICATE, TORRENT_DIRECT_LIMIT, TAR_UNZIP_LIMIT
|
from bot import aria2, download_dict_lock, STOP_DUPLICATE, TORRENT_DIRECT_LIMIT, TAR_UNZIP_LIMIT
|
||||||
from bot.helper.mirror_utils.upload_utils.gdriveTools import GoogleDriveHelper
|
from bot.helper.mirror_utils.upload_utils.gdriveTools import GoogleDriveHelper
|
||||||
from bot.helper.ext_utils.bot_utils import *
|
from bot.helper.ext_utils.bot_utils import *
|
||||||
from .download_helper import DownloadHelper
|
|
||||||
from bot.helper.mirror_utils.status_utils.aria_download_status import AriaDownloadStatus
|
from bot.helper.mirror_utils.status_utils.aria_download_status import AriaDownloadStatus
|
||||||
from bot.helper.telegram_helper.message_utils import *
|
from bot.helper.telegram_helper.message_utils import *
|
||||||
import threading
|
import threading
|
||||||
|
|
@ -9,7 +8,7 @@ from aria2p import API
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
|
|
||||||
class AriaDownloadHelper(DownloadHelper):
|
class AriaDownloadHelper:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
|
||||||
|
|
@ -78,9 +78,7 @@ class qbittorrent:
|
||||||
LOGGER.info(f"QbitDownload started: {tor_info.name}")
|
LOGGER.info(f"QbitDownload started: {tor_info.name}")
|
||||||
self.updater = setInterval(self.update_interval, self.update)
|
self.updater = setInterval(self.update_interval, self.update)
|
||||||
if BASE_URL is not None and qbitsel:
|
if BASE_URL is not None and qbitsel:
|
||||||
if is_file:
|
if not is_file:
|
||||||
self.client.torrents_pause(torrent_hashes=self.ext_hash)
|
|
||||||
else:
|
|
||||||
meta = sendMessage("Downloading Metadata...Please wait then you can select files or mirror torrent file if it have low seeders", listener.bot, listener.update)
|
meta = sendMessage("Downloading Metadata...Please wait then you can select files or mirror torrent file if it have low seeders", listener.bot, listener.update)
|
||||||
while True:
|
while True:
|
||||||
tor_info = self.client.torrents_info(torrent_hashes=self.ext_hash)
|
tor_info = self.client.torrents_info(torrent_hashes=self.ext_hash)
|
||||||
|
|
@ -92,12 +90,13 @@ class qbittorrent:
|
||||||
if tor_info.state == "metaDL" or tor_info.state == "checkingResumeData":
|
if tor_info.state == "metaDL" or tor_info.state == "checkingResumeData":
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
else:
|
else:
|
||||||
self.client.torrents_pause(torrent_hashes=self.ext_hash)
|
time.sleep(2)
|
||||||
deleteMessage(listener.bot, meta)
|
deleteMessage(listener.bot, meta)
|
||||||
break
|
break
|
||||||
except:
|
except:
|
||||||
deleteMessage(listener.bot, meta)
|
deleteMessage(listener.bot, meta)
|
||||||
return False
|
return False
|
||||||
|
self.client.torrents_pause(torrent_hashes=self.ext_hash)
|
||||||
for n in str(self.ext_hash):
|
for n in str(self.ext_hash):
|
||||||
if n.isdigit():
|
if n.isdigit():
|
||||||
pincode += str(n)
|
pincode += str(n)
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import re
|
||||||
import json
|
import json
|
||||||
import requests
|
import requests
|
||||||
import logging
|
import logging
|
||||||
|
import time
|
||||||
from random import randrange
|
from random import randrange
|
||||||
|
|
||||||
from google.auth.transport.requests import Request
|
from google.auth.transport.requests import Request
|
||||||
|
|
@ -23,7 +24,7 @@ from bot.helper.telegram_helper import button_build
|
||||||
from telegraph import Telegraph
|
from telegraph import Telegraph
|
||||||
from bot import parent_id, DOWNLOAD_DIR, IS_TEAM_DRIVE, INDEX_URL, \
|
from bot import parent_id, DOWNLOAD_DIR, IS_TEAM_DRIVE, INDEX_URL, \
|
||||||
USE_SERVICE_ACCOUNTS, telegraph_token, BUTTON_FOUR_NAME, BUTTON_FOUR_URL, BUTTON_FIVE_NAME, BUTTON_FIVE_URL, BUTTON_SIX_NAME, BUTTON_SIX_URL, SHORTENER, SHORTENER_API, VIEW_LINK
|
USE_SERVICE_ACCOUNTS, telegraph_token, BUTTON_FOUR_NAME, BUTTON_FOUR_URL, BUTTON_FIVE_NAME, BUTTON_FIVE_URL, BUTTON_SIX_NAME, BUTTON_SIX_URL, SHORTENER, SHORTENER_API, VIEW_LINK
|
||||||
from bot.helper.ext_utils.bot_utils import *
|
from bot.helper.ext_utils.bot_utils import get_readable_file_size, setInterval
|
||||||
from bot.helper.ext_utils.fs_utils import get_mime_type, get_path_size
|
from bot.helper.ext_utils.fs_utils import get_mime_type, get_path_size
|
||||||
|
|
||||||
LOGGER = logging.getLogger(__name__)
|
LOGGER = logging.getLogger(__name__)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue