-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_backend.py
More file actions
43 lines (34 loc) · 1.74 KB
/
debug_backend.py
File metadata and controls
43 lines (34 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import requests
from bs4 import BeautifulSoup
# Test the exact logic from the backend
movie_url = "https://www.5movierulz.voyage/bhartha-mahasayulaku-wignyapthi-2026-telugu/movie-watch-online-free-6250.html"
req = requests.get(movie_url).content
soup = BeautifulSoup(req, "html.parser")
paragraphs = soup.find("div", class_="entry-content").find_all("p")
other_links = []
for p in paragraphs:
strong = p.find("strong")
if strong and "Watch Online" in strong.get_text():
typ = strong.get_text().split("–")[-1].strip()
a = p.find("a")
if a and a.get("href"):
href = a["href"]
print(f"Original href: {repr(href)}")
# Clean up the URL - remove newlines and extract proper format
href = href.replace('\r', '').replace('\n', '').strip()
print(f"After cleaning: {repr(href)}")
# Fix malformed URLs - the ID is getting mixed with the domain
if 'streamlare' in typ.lower():
# Handle Streamlare URLs like "https://ww7.vcdnlare.com/v/NxcpZiXX9B70T9R?sid=7699&t=hls"
if 'vcdnlare.com/v/' in href:
# Extract the video ID part (after the last /)
if '/' in href:
parts = href.split('/')
print(f"Split parts: {parts}")
video_id = parts[-1] # Get the last part
href = f"https://ww7.vcdnlare.com/v/{video_id}"
print(f"Fixed href: {repr(href)}")
other_links.append({"type": typ, "url": href})
print(f"Final result: {other_links[-1]}")
print("---")
break # Just test first one