From 8d4137ff85bd1591931094d3e7adcd4f72ed8206 Mon Sep 17 00:00:00 2001 From: Xonshiz Date: Wed, 13 Jan 2021 12:34:23 +0530 Subject: [PATCH] IP Limit Bypass Added way to bypass IP Limit --- src/.DS_Store | Bin 0 -> 6148 bytes src/movies.py | 19 ++++++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 src/.DS_Store diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..c88a062b05be4fd1d362b3e4c6a7481e718b69d0 GIT binary patch literal 6148 zcmeH~O$x$5422WzLU7Zi%h`AUZ!n0Spcima5J4*Vx1OW>k_m#k8KJGkN^pg011%5 z4-v3?8#bF)Wh4O-Ab}?V`#vPNX$~z_{nLTqBLK8P*$r!-C7{U)&>UK-q5{*H9yD6j z#}KP~J2b_)99pW@cF`C;crrWIXQgOGwy`I%~QMGk}L;X0y%TE9jyNVZZH|!@{KyzrRiVBQB0*--!1inh( E0rZ6u#{d8T literal 0 HcmV?d00001 diff --git a/src/movies.py b/src/movies.py index 39cde45..3a4412b 100644 --- a/src/movies.py +++ b/src/movies.py @@ -16,6 +16,7 @@ from bs4 import BeautifulSoup class Movies: def __init__(self, argv, cwd): print("Main") + self.queue = [] related_episodes = [] url = None file_name = None @@ -29,7 +30,7 @@ class Movies: if url: self.get_episode_list(url=url) - def single_episode(self, url, file_name): + def single_episode(self, url, file_name, add_to_queue=False): xml_request_data = get_xml_http_request(url) if xml_request_data and xml_request_data == "none": print("IP Limit Reached") @@ -93,9 +94,13 @@ class Movies: if file_written: print("Downloaded : {0}".format(file_name)) yt_command = utils.get_youtube_dl_command(file_location=path_created + os.sep + video_file_name, video_url=video_url) - print("Youtube-dl Command: {0}".format(yt_command)) - process_code = utils.call_youtube_dl(yt_command) - print("Process Done: {0}".format(process_code)) + if add_to_queue: + print("Added To Queue") + self.queue.append(yt_command) + else: + print("Youtube-dl Command: {0}".format(yt_command)) + process_code = utils.call_youtube_dl(yt_command) + print("Process Done: {0}".format(process_code)) return 0 def get_episode_list(self, url): @@ -119,6 +124,10 @@ class Movies: related_episodes.append(str(url)) print("Total Episodes To Download: {0}".format(len(related_episodes))) for episode_url in related_episodes: - self.single_episode(url=episode_url, file_name=None) + self.single_episode(url=episode_url, file_name=None, add_to_queue=True) + for current_command in self.queue: + print(current_command) + process_code = utils.call_youtube_dl(current_command) + print("Process Done: {0}".format(process_code)) return 0