Created
November 30, 2022 02:45
-
-
Save AdamQuixote/d3e90958b2be46ebf1cd24faa42fb77b to your computer and use it in GitHub Desktop.
fgdownloader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| import re | |
| import webbrowser | |
| import datetime | |
| now = datetime.datetime.now() | |
| year = now.year | |
| month = now.month | |
| months = 12 | |
| years = 1 | |
| def get_page(cyear, cmonth, page): | |
| if page == 1: | |
| return f'https://fitgirl-repacks.site/{cyear}/{cmonth}/' | |
| else: | |
| return f'https://fitgirl-repacks.site/{cyear}/{cmonth}/page/{page}/' | |
| def get_links(url): | |
| page = requests.get(url) | |
| if '<h1 class="page-title">Not Found</h1>' in page.text: | |
| return 'done' | |
| links = re.findall(r'(magnet:\?.*)', page.text) | |
| return links | |
| def open_links(links): | |
| for link in links: | |
| if link.startswith('magnet:?'): | |
| print(link) | |
| webbrowser.open(link) | |
| def main(): | |
| for y in range(year - years, year + 1): | |
| for m in range(month - months, month + 1): | |
| if m < 1: | |
| m += 12 | |
| print(f'year: {y}, month: {m}') | |
| for p in range(1, 201): | |
| url = get_page(y, m, p) | |
| links = get_links(url) | |
| if links == 'done': | |
| break | |
| print(f'opening {url}') | |
| open_links(links) | |
| if __name__ == '__main__': | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment