Spaces:
Paused
Paused
Update main.py
Browse files
main.py
CHANGED
|
@@ -386,10 +386,13 @@ def get_movie_info(name: str, api_key: str = Header(...)):
|
|
| 386 |
genre = n_soup.findAll("h2")[1].text
|
| 387 |
likes = info.find("span", id="movie-likes").text
|
| 388 |
imdb_link = info.find("a", title="IMDb Rating")["href"]
|
|
|
|
| 389 |
for torrent in torrent_info.findAll("a"):
|
| 390 |
-
if
|
|
|
|
|
|
|
| 391 |
torrent_720 = torrent["href"]
|
| 392 |
-
|
| 393 |
torrent_1080 = torrent["href"]
|
| 394 |
entry = {
|
| 395 |
"yts_link": movie_url,
|
|
@@ -400,7 +403,8 @@ def get_movie_info(name: str, api_key: str = Header(...)):
|
|
| 400 |
"imdb_ratings": rating,
|
| 401 |
"likes": likes,
|
| 402 |
"torrent_720p": torrent_720,
|
| 403 |
-
"torrent_1080p": torrent_1080
|
|
|
|
| 404 |
}
|
| 405 |
results.append(entry)
|
| 406 |
except Exception as e:
|
|
|
|
| 386 |
genre = n_soup.findAll("h2")[1].text
|
| 387 |
likes = info.find("span", id="movie-likes").text
|
| 388 |
imdb_link = info.find("a", title="IMDb Rating")["href"]
|
| 389 |
+
magnet_links = []
|
| 390 |
for torrent in torrent_info.findAll("a"):
|
| 391 |
+
if "magnet" in torrent["href"]:
|
| 392 |
+
magnet_links.append(torrent["href"])
|
| 393 |
+
elif torrent.text[:3] == "720":
|
| 394 |
torrent_720 = torrent["href"]
|
| 395 |
+
elif torrent.text[:4] == "1080":
|
| 396 |
torrent_1080 = torrent["href"]
|
| 397 |
entry = {
|
| 398 |
"yts_link": movie_url,
|
|
|
|
| 403 |
"imdb_ratings": rating,
|
| 404 |
"likes": likes,
|
| 405 |
"torrent_720p": torrent_720,
|
| 406 |
+
"torrent_1080p": torrent_1080,
|
| 407 |
+
"magnet_links": magnet_links
|
| 408 |
}
|
| 409 |
results.append(entry)
|
| 410 |
except Exception as e:
|