def test_get_torrents_invalid_values(self): ezflix = Ezflix(query='-1', limit=-2, media_type='movie') torrents = ezflix.search() self.assertIsNone(torrents) self.assertIsNone(ezflix.torrent_info(0)) self.assertIsNone(ezflix.torrent_info(100)) ezflix = Ezflix(query='platoon', media_type='movie', limit=-2) torrents = ezflix.search() self.assertTrue(len(torrents) == 0) self.assertIsNone(ezflix.torrent_info(0)) ezflix = Ezflix(query='wow', limit=-2, media_type='movie') torrents = ezflix.similar(-1) self.assertIsNone(torrents)
def torrent_view(request): qb = Client('http://127.0.0.1:8080/') qb.login('admin', 'adminadmin') BASE_DIR = Path(__file__).resolve().parent.parent d_path = os.path.join(BASE_DIR, 'static/folder/') print("Location : ", qb.get_default_save_path()) if request.method == 'POST': ezflix = Ezflix(query=request.POST['title1'], media_type='movie', quality='720p', limit=1) shows = ezflix.search() # magnet = 'https://webtorrent.io/torrents/big-buck-bunny.torrent' magnet = 'https://webtorrent.io/torrents/cosmos-laundromat.torrent' if shows is not None: for s in shows: if s['imdb'] == request.POST['imdb1']: print(s['link']) # torrent_location=Torrent.objects.filter(Info_code=s['title'])[0] # print ("Finally",torrent_location.title) # print(torrent_location) qb.download_from_link(magnet, savepath=d_path) time.sleep(90) torrents = qb.torrents(filter='downloading') # for k in info_hash # k.Info code # print("This is the info") path_torrent = Torrent_details(torrents, qb, s['title']) print( '--------------------------------------------------------------------------------------' ) else: print("Not found") return HttpResponse(path_torrent)
def test_get_torrents(self): ezflix = Ezflix(query="Man in the high castle", limit=20, debug=True, quality="720p") torrents = ezflix.search() self.assertTrue(0 <= len(torrents) <= 20)
def test_movie_get_torrents_by_quality(self): ezflix = Ezflix(query='Mad Max', media_type="movie", limit=20, quality="720p", debug=True, cli_mode=True) torrents = ezflix.search() for torrent in torrents: self.assertIn("720", torrent['title'])
def test_get_subtitles(self): ezflix = Ezflix(query='Mad Max', media_type='movie', limit=20) torrents = ezflix.search() self.assertTrue(len(torrents) > 0) movie_title = torrents[0]['title'] subtitles = ezflix.search_subtitles(movie_title) self.assertIsNotNone(subtitles) cur_dir = os.getcwd() file_list = os.listdir(cur_dir) for f in file_list: if movie_title in f: os.remove(f)
def test_movie_get_similar(self): ezflix = Ezflix(query='Thin Red Line', media_type="movie", limit=20, quality="720p", debug=True, cli_mode=True) torrents = ezflix.search() self.assertTrue(len(torrents) > 0) print(torrents) similar = ezflix.similar(1) self.assertTrue(len(similar) > 0) print(similar)
from ezflix import Ezflix ezflix = Ezflix(query='Goodfellas', media_type='movie', quality='720p', limit=1) movies = ezflix.search() for movie in movies: print(movie['magnet'])
from ezflix import Ezflix ezflix = Ezflix(query='chernobyl') shows = ezflix.search() print("Found %s shows" % len(shows)) for s in shows: print(s['magnet'])
def test_get_magnet(self): ezflix = Ezflix(query="Man in the high castle", limit=20) torrents = ezflix.search() self.assertTrue(len(torrents) > 0) self.assertIsNotNone(ezflix.torrent_info(1))