Skip to content

Commit

Permalink
Fix rss user tag when using channel
Browse files Browse the repository at this point in the history
Signed-off-by: anasty17 <[email protected]>
  • Loading branch information
anasty17 committed Nov 17, 2023
1 parent 88f60f3 commit ec85cf3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
10 changes: 7 additions & 3 deletions bot/helper/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ def __init__(self, message):
self.message = message
self.mid = self.message.id
self.user = self.message.from_user or self.message.sender_chat
self.user_id = self.user.id
self.user_dict = user_data.get(self.user_id, {})
self.user_dict = {}
self.sameDir = {}
self.bulk = []
self.dir = f"{DOWNLOAD_DIR}{self.mid}"
Expand All @@ -73,6 +72,7 @@ def __init__(self, message):
self.name = ""
self.session = ""
self.newDir = ""
self.user_id = 0
self.multiTag = 0
self.splitSize = 0
self.maxSplitSize = 0
Expand Down Expand Up @@ -291,6 +291,8 @@ async def getTag(self, text: list):
if len(text) > 1 and text[1].startswith("Tag: "):
self.tag, id_ = text[1].split("Tag: ")[1].split()
self.user = self.message.from_user = await self.client.get_users(id_)
self.user_id = self.user.id
self.user_dict = user_data.get(self.user_id, {})
try:
await self.message.unpin()
except:
Expand Down Expand Up @@ -612,7 +614,9 @@ async def generateSampleVideo(self, dl_path, size, gid):
)
return res
else:
for dirpath, _, files in await sync_to_async(walk, dl_path, topdown=False):
for dirpath, _, files in await sync_to_async(
walk, dl_path, topdown=False
):
for file_ in files:
f_path = ospath.join(dirpath, file_)
if (await get_document_type(f_path))[0]:
Expand Down
4 changes: 2 additions & 2 deletions bot/modules/clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def __init__(
self,
client,
message,
isQbit=False,
isLeech=False,
_,
__,
sameDir=None,
bulk=None,
multiTag=None,
Expand Down
6 changes: 3 additions & 3 deletions bot/modules/ytdlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def __init__(
self,
client,
message,
isQbit=False,
_,
isLeech=False,
sameDir=None,
bulk=None,
Expand Down Expand Up @@ -359,6 +359,8 @@ async def newEvent(self):

path = f"{DOWNLOAD_DIR}{self.mid}{folder_name}"

await self.getTag(text)

opt = opt or self.user_dict.get("yt_opt") or config_dict["YT_DLP_OPTIONS"]

if not self.link and (reply_to := self.message.reply_to_message):
Expand Down Expand Up @@ -402,8 +404,6 @@ async def newEvent(self):

options["playlist_items"] = "0"

await self.getTag(text)

try:
result = await sync_to_async(extract_info, self.link, options)
except Exception as e:
Expand Down

0 comments on commit ec85cf3

Please sign in to comment.