Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -350,7 +350,12 @@ async def get_torrent_info(url):
|
|
350 |
html = await response.text()
|
351 |
soup = BeautifulSoup(html, "html.parser")
|
352 |
torrents = []
|
353 |
-
for div in soup.find_all("div", class_="
|
|
|
|
|
|
|
|
|
|
|
354 |
quality = div.find("div", class_="modal-quality").find("span").text
|
355 |
all_p = div.find_all("p", class_="quality-size")
|
356 |
quality_type = all_p[0].text if all_p else "N/A"
|
@@ -358,8 +363,10 @@ async def get_torrent_info(url):
|
|
358 |
torrent_link = div.find("a", class_="download-torrent")["href"]
|
359 |
magnet = div.find("a", class_="magnet-download")["href"]
|
360 |
hash = re.search(r"([{a-f\d,A-F\d}]{32,40})\b", magnet).group(0)
|
|
|
361 |
torrents.append(
|
362 |
{
|
|
|
363 |
"quality": quality,
|
364 |
"type": quality_type,
|
365 |
"size": size,
|
|
|
350 |
html = await response.text()
|
351 |
soup = BeautifulSoup(html, "html.parser")
|
352 |
torrents = []
|
353 |
+
for div in soup.find_all("div", class_="container", id="movie-content"):
|
354 |
+
poster = div.find("img", itemprop="image")
|
355 |
+
if poster:
|
356 |
+
poster_url = poster["src"]
|
357 |
+
else:
|
358 |
+
poster_url = "N/A"
|
359 |
quality = div.find("div", class_="modal-quality").find("span").text
|
360 |
all_p = div.find_all("p", class_="quality-size")
|
361 |
quality_type = all_p[0].text if all_p else "N/A"
|
|
|
363 |
torrent_link = div.find("a", class_="download-torrent")["href"]
|
364 |
magnet = div.find("a", class_="magnet-download")["href"]
|
365 |
hash = re.search(r"([{a-f\d,A-F\d}]{32,40})\b", magnet).group(0)
|
366 |
+
|
367 |
torrents.append(
|
368 |
{
|
369 |
+
"poster": poster_url,
|
370 |
"quality": quality,
|
371 |
"type": quality_type,
|
372 |
"size": size,
|