diff --git a/README.md b/README.md index 043aaf1..e05ea3e 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ $ python install -r requirements.txt There are some more external command-line programs that are essential to movies, tv-shows, and streaming: - rTorrent: [Windows](https://rtwi.jmk.hu/wiki/rTorrentOnWindows), [OSX](http://macappstore.org/rtorrent/), Ubuntu: - + ```bash $ sudo apt-get install rtorrent ``` @@ -63,19 +63,19 @@ On a personal judgement, we would judge that the complete meta-data parsing work ### Usage ```bash -$ IRS (stream | download) movie -$ IRS (stream | download) tv -$ IRS (stream | download) song by -$ IRS (stream | download) album by +$ irs (stream | download) movie +$ irs (stream | download) tv +$ irs (stream | download) song by +$ irs (stream | download) album by ``` ##### Examples ```bash -$ IRS stream movie Fight Club -$ IRS download album A Night At The Opera by Queen -$ IRS stream song Where Is My Mind by The Pixies -$ IRS download tv mr.robot s01e01 -$ IRS stream album A Day At The Races by Queen +$ irs stream movie Fight Club +$ irs download album A Night At The Opera by Queen +$ irs stream song Where Is My Mind by The Pixies +$ irs download tv mr.robot s01e01 +$ irs stream album A Day At The Races by Queen ``` ### Disclaimer Copyrighted content may be illegal to stream and/or download in your country. diff --git a/irs.py b/irs.py index 1976731..5b55b9e 100644 --- a/irs.py +++ b/irs.py @@ -184,24 +184,21 @@ def get_album(album_name, artist, what_to_do): def get_torrent_url(args, category): search_url = 'https://kat.cr/usearch/' + urllib.parse.quote_plus((" ".join(args) + " category:" + category)) - print (search_url) - #time.sleep(5) search_request_response = requests.get(search_url, verify=True) soup = BeautifulSoup(search_request_response.text, 'html.parser') - choice = False i = 0 + print ("") while choice == False: - movie_page = soup.find_all("a", class_="cellMainLink")[i] - print (movie_page.string) - a = input("%s Is this torrent what you want? Y/n " % output("q")) - if a.lower() == 'y': - search_url = requests.get('https://kat.cr' + movie_page.get('href'), verify=True) + movie_page = soup.find_all("a", class_="cellMainLink") + for number in range(0,5): + print ("%s. " % (number + 1) + movie_page[number].string) + a = int(str(input("\n%s What torrent would you like? " % output("q")))) - 1 + if a in (0, 1, 2, 3, 4): + search_url = requests.get('https://kat.cr' + movie_page[a].get('href'), verify=True) soup = BeautifulSoup(search_url.text, 'html.parser') torrent_url = 'https:' + soup.find_all('a', class_='siteButton')[0].get('href') choice = True - elif a == 'n': - i += 1 return torrent_url def main():