Chrunos commited on
Commit
758b367
·
verified ·
1 Parent(s): 367d17a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -12
app.py CHANGED
@@ -447,20 +447,12 @@ def extract_video_info(video_url: str) -> str:
447
  })
448
  title = json_response.get('title')
449
  logger.info(title)
450
- '''if "pornhub.com" in video_url:
451
- # Remove special characters using a regular expression
452
- title = re.sub(r'[^a-zA-Z0-9\s]', '', title)
453
- # Replace multiple spaces with a single space
454
- title = re.sub(r'\s+', ' ', title)
455
- title = title.lower()
456
- # Replace spaces with hyphens
457
- title = title.strip().replace(' ', '-')
458
- logger.info(title)
459
- p_result = process_url(title)
460
  return p_result
461
  else:
462
- '''
463
- return result
464
  else:
465
  return {"error": "No formats available"}
466
  else:
 
447
  })
448
  title = json_response.get('title')
449
  logger.info(title)
450
+ if "pornhub.com" in video_url:
451
+ p_result = [item for item in result if 'hls' in item['format_id']]
 
 
 
 
 
 
 
 
452
  return p_result
453
  else:
454
+ new_result = [item for item in result if 'hls' not in item['format_id']]
455
+ return new_result
456
  else:
457
  return {"error": "No formats available"}
458
  else: