Skip to content

Commit

Permalink
Scrape torrent ids via HTML if not already populated
Browse files Browse the repository at this point in the history
  • Loading branch information
yachtrock87 committed Sep 21, 2024
1 parent 506eaf3 commit 2a685dd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ptpapi/movie.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ def load_html_data(self):
self.data["Snatched"] = True

# File list & trumpability for torrents
# Populate torrent IDs if not already populated
if "Torrents" not in self.data.keys():
self.data["Torrents"] = [torrent.Torrent(
re.match(r"torrent_(\d*)", torr['id']).group(1)) for torr in soup.find_all("tr", class_="torrent_info_row")]
for tor in self.data["Torrents"]:
# Get file list
filediv = soup.find("div", id="files_%s" % tor.ID)
Expand Down

0 comments on commit 2a685dd

Please sign in to comment.