BinaryONe commited on
Commit
c140fac
ยท
1 Parent(s): 92e93c1

Callback Update

Browse files
FileStream/Tools/cleanup.py CHANGED
@@ -1,6 +1,6 @@
1
  import re
2
 
3
- #words_to_remove = ["FC","HEVC","ษดแด€แดแด‡:","-","BuLMoviee" ,"๐—๐—ผ๐—ถ๐—ป ๐—จ๐˜€ ๐—ข๐—ป ๐—ง๐—ฒ๐—น๐—ฒ๐—ด๐—ฟ๐—ฎ๏ฟฝ","SIDHUU 591","๐‘ฑ๐’๐’Š๐’ ๐‘ผ๐’” ๐‘ถษด ๐‘ปแด‡สŸแด‡ษขส€แด€แด","Tษชแด›สŸแด‡ :"]
4
 
5
  def remove_words(text, words_to_remove):
6
  # Join the words to remove into a single regex pattern
@@ -50,11 +50,32 @@ def clean_text(input_text):
50
  return output_text
51
 
52
 
53
-
54
  def Get_Title_Year(name):
55
  # Regex to match title and year
56
- words_to_remove = ["FษชสŸแด‡","FษชสŸแด‡ ษดแด€แดแด‡ :","FC", "HEVC","ษดแด€แดแด‡","-","BuLMoviee" ,"๐—๐—ผ๐—ถ๐—ป ๐—จ๐˜€ ๐—ข๐—ป ๐—ง๐—ฒ๐—น๐—ฒ๐—ด๐—ฟ๐—ฎ๏ฟฝ","๐—๐—ผ๐—ถ๐—ป ๐—จ๐˜€ ๐—ข๐—ป ๐—ง๐—ฒ๐—น๐—ฒ๐—ด๐—ฟ๐—ฎ๐—บ","SIDHUU 591","๐‘ฑ๐’๐’Š๐’ ๐‘ผ๐’” ๐‘ถษด ๐‘ปแด‡สŸแด‡ษขส€แด€แด","Tษชแด›สŸแด‡ :","Bollywood","mkv","Mแดแด ษชแด‡", "ษขส€แดแดœแด˜" , "TGxMALLU_MOVIE"]
57
- name=remove_words(name, words_to_remove)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  match = re.search(r'(?P<title>.+?)[\s\.\(\)]*(?P<year>\d{4})',name )
59
 
60
  if match:
 
1
  import re
2
 
3
+ # words_to_remove = ["FC","HEVC","ษดแด€แดแด‡:","-","BuLMoviee" ,"๐—๐—ผ๐—ถ๐—ป ๐—จ๐˜€ ๐—ข๐—ป ๐—ง๐—ฒ๐—น๐—ฒ๐—ด๐—ฟ๐—ฎ๏ฟฝ","SIDHUU 591","๐‘ฑ๐’๐’Š๐’ ๐‘ผ๐’” ๐‘ถษด ๐‘ปแด‡สŸแด‡ษขส€แด€แด","Tษชแด›สŸแด‡ :"]
4
 
5
  def remove_words(text, words_to_remove):
6
  # Join the words to remove into a single regex pattern
 
50
  return output_text
51
 
52
 
 
53
  def Get_Title_Year(name):
54
  # Regex to match title and year
55
+ words_to_remove = [
56
+ "FษชสŸแด‡",
57
+ "FษชสŸแด‡ ษดแด€แดแด‡ :",
58
+ "FC",
59
+ "HEVC",
60
+ "ษดแด€แดแด‡",
61
+ "Tษชแด›สŸแด‡ :",
62
+ "-",
63
+ "BuLMoviee",
64
+ "๐—๐—ผ๐—ถ๐—ป ๐—จ๐˜€ ๐—ข๐—ป ๐—ง๐—ฒ๐—น๐—ฒ๐—ด๐—ฟ๐—ฎ๏ฟฝ",
65
+ "๐—๐—ผ๐—ถ๐—ป ๐—จ๐˜€ ๐—ข๐—ป ๐—ง๐—ฒ๐—น๐—ฒ๐—ด๐—ฟ๐—ฎ๐—บ",
66
+ "SIDHUU 591",
67
+ "๐‘ฑ๐’๐’Š๐’ ๐‘ผ๐’” ๐‘ถษด ๐‘ปแด‡สŸแด‡ษขส€แด€แด",
68
+ "Tษชแด›สŸแด‡ :",
69
+ "Bollywood",
70
+ "mkv",
71
+ "Mแดแด ษชแด‡",
72
+ "ษขส€แดแดœแด˜",
73
+ "TGxMALLU_MOVIE",
74
+ "[Tg-@New_Movies_OnTG]",
75
+ "[@ClipmateEmpire]",
76
+ "@Horek_Rokom2020"
77
+ ]
78
+ name = remove_words(name, words_to_remove)
79
  match = re.search(r'(?P<title>.+?)[\s\.\(\)]*(?P<year>\d{4})',name )
80
 
81
  if match:
FileStream/utils/FileProcessors/bot_utils.py CHANGED
@@ -12,6 +12,8 @@ from FileStream.Database import Database
12
  from FileStream.utils.FileProcessors.human_readable import humanbytes
13
  from FileStream.config import Telegram, Server
14
  from FileStream.bot import FileStream
 
 
15
 
16
 
17
  db = Database(Telegram.DATABASE_URL, Telegram.SESSION_NAME)
@@ -105,8 +107,10 @@ async def upload_type_func(file_info,replied_message):
105
  return reply_markup, stream_text
106
 
107
  else:
108
-
109
- stream_text = LANG.STREAM_TEXT_Y.format(file_info['file']['file_name'],humanbytes(file_info['file']['file_size']))
 
 
110
  reply_markup = InlineKeyboardMarkup([[
111
  InlineKeyboardButton(
112
  "PUBLIC UPLOAD",
 
12
  from FileStream.utils.FileProcessors.human_readable import humanbytes
13
  from FileStream.config import Telegram, Server
14
  from FileStream.bot import FileStream
15
+ from FileStream.Tools.cleanup import Get_Title_Year
16
+
17
 
18
 
19
  db = Database(Telegram.DATABASE_URL, Telegram.SESSION_NAME)
 
107
  return reply_markup, stream_text
108
 
109
  else:
110
+
111
+ name = file_info['file']['caption'] if file_info['file']['caption'] else file_info['file']['file_name']
112
+ title, year = Get_Title_Year(name)
113
+ stream_text = LANG.STREAM_TEXT_Y.format(file_info['file']['file_name'],str(title+" "+year),humanbytes(file_info['file']['file_size']))
114
  reply_markup = InlineKeyboardMarkup([[
115
  InlineKeyboardButton(
116
  "PUBLIC UPLOAD",
FileStream/utils/FileProcessors/translation.py CHANGED
@@ -44,6 +44,7 @@ class LANG(object):
44
  STREAM_TEXT_Y = """
45
  <b>๐Ÿช‚ : ๐”น๐•Šโ„™๐”ธโ„๐•‚ ๐”ปโ„๐•€๐•๐”ผ : ๐Ÿช‚</b>\n
46
  <b>๐Ÿ“‚ FษชสŸแด‡ ษดแด€แดแด‡ :</b> <b>{}</b>\n
 
47
  <b>๐Ÿ“ฆ FษชสŸแด‡ ๊œฑษชแดขแด‡ :</b> <code>{}</code>\n
48
  """
49
 
 
44
  STREAM_TEXT_Y = """
45
  <b>๐Ÿช‚ : ๐”น๐•Šโ„™๐”ธโ„๐•‚ ๐”ปโ„๐•€๐•๐”ผ : ๐Ÿช‚</b>\n
46
  <b>๐Ÿ“‚ FษชสŸแด‡ ษดแด€แดแด‡ :</b> <b>{}</b>\n
47
+ <b>๐Ÿ“‚ ๐–ฃ๐–พ๐—‹๐—‚๐—๐–พ๐–ฝ ๐–ญ๐–บ๐—†๐–พ :</b> <b>{}</b>\n
48
  <b>๐Ÿ“ฆ FษชสŸแด‡ ๊œฑษชแดขแด‡ :</b> <code>{}</code>\n
49
  """
50