randydev commited on
Commit
a811e40
Β·
verified Β·
1 Parent(s): cc5ddaf

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +7 -9
main.py CHANGED
@@ -206,10 +206,6 @@ async def searchhub(client: Client, message: Message):
206
  try:
207
  user_status = check_user_expiration(user_id)
208
  protect_content = not user_status["free_mode"]
209
- if user_status["free_mode"]:
210
- await message.reply("Free mode is active. Sending unprotected content.")
211
- else:
212
- await message.reply("Free mode is inactive or expired. Sending protected content.")
213
  response = await api.x_search(query=query)
214
  if response is None:
215
  return await pro.edit_text("nothing found gay")
@@ -246,6 +242,12 @@ async def searchhub(client: Client, message: Message):
246
  except Exception as e:
247
  await pro.edit_text(str(e))
248
 
 
 
 
 
 
 
249
  @client.on_message(
250
  filters.incoming
251
  & filters.command(["hubdl"])
@@ -257,16 +259,12 @@ async def porno_download(client: Client, message: Message):
257
  link = message.text.split(" ", 1)[1] if len(message.command) > 1 else None
258
  if not link:
259
  return await message.reply_text("please link for pornohub.")
260
- if not link.startswith("https://www.xnxx.com/"):
261
  return await message.reply_text("invalid link.")
262
  pro = await message.reply_text("Processing.....")
263
  try:
264
  user_status = check_user_expiration(user_id)
265
  protect_content = not user_status["free_mode"]
266
- if user_status["free_mode"]:
267
- await message.reply("Free mode is active. Sending unprotected content.")
268
- else:
269
- await message.reply("Free mode is inactive or expired. Sending protected content.")
270
  file_path, thumb, _ = await api.x_download(url=link, is_stream=True)
271
  upload_text = f"**⬆️ π–΄π—‰π—…π—ˆπ–Ίπ–½π—‚π—‡π—€ video ...**"
272
  await pro.edit_text(upload_text)
 
206
  try:
207
  user_status = check_user_expiration(user_id)
208
  protect_content = not user_status["free_mode"]
 
 
 
 
209
  response = await api.x_search(query=query)
210
  if response is None:
211
  return await pro.edit_text("nothing found gay")
 
242
  except Exception as e:
243
  await pro.edit_text(str(e))
244
 
245
+ def is_pornohub_url(url):
246
+ import re
247
+ pattern = r"(https?)://www\.xnxx\.com/([\w\-]+)?/(\w+)"
248
+ match = re.search(pattern, url)
249
+ return bool(match)
250
+
251
  @client.on_message(
252
  filters.incoming
253
  & filters.command(["hubdl"])
 
259
  link = message.text.split(" ", 1)[1] if len(message.command) > 1 else None
260
  if not link:
261
  return await message.reply_text("please link for pornohub.")
262
+ if not is_pornohub_url(link):
263
  return await message.reply_text("invalid link.")
264
  pro = await message.reply_text("Processing.....")
265
  try:
266
  user_status = check_user_expiration(user_id)
267
  protect_content = not user_status["free_mode"]
 
 
 
 
268
  file_path, thumb, _ = await api.x_download(url=link, is_stream=True)
269
  upload_text = f"**⬆️ π–΄π—‰π—…π—ˆπ–Ίπ–½π—‚π—‡π—€ video ...**"
270
  await pro.edit_text(upload_text)