From aa1efd527600c3ed774a7df0390598c6802daecf Mon Sep 17 00:00:00 2001 From: Pagasis <74396469+Pagasis@users.noreply.github.com> Date: Mon, 1 Nov 2021 11:29:56 +0530 Subject: [PATCH 1/3] Add files via upload --- requirements.txt | 3 +++ setup.py | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 requirements.txt create mode 100644 setup.py diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..b992532 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +crypto +pyxattr +youtube_dl \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..76b0e8a --- /dev/null +++ b/setup.py @@ -0,0 +1,52 @@ +import sys +import subprocess +import os +# importing urllib.requests for internet cheking funtions +import urllib.request + +# To check if the system is connected to the internet +def connect(host='https://google.com/'): + # trying to open gfg + try: + urllib.request.urlopen(host) + return True + + # trying to catch exception when internet is not ON. + except: + return False + +# Reading package names +with open("requirements.txt",'r') as file: + package_q = file.readlines() + + for package in package_q: + # removing '\n' + package = package[:-2] + +def setup(module_name): + + # updating pip to latest version + subprocess.run('python -m pip install --upgrade pip') + + # commanding terminal to pip install required modules + p = subprocess.run('pip3 install '+module_name) + + # internet off + if(p.returncode == 1 and connect() == False): + print("error!! occured check\nInternet conection") + + # Every thing worked fine + elif(p.returncode == 0): + print("It worked", module_name, " is installed") + + # Name of module wrong + elif(p.returncode == 1 and connect() == True): + print("error!! occured check\nName of module") + +print('Installing') +print('Please wait....') +print('Do not close this program') +for package in package_q: #sending module names to the setup_a funtion + setup(package) +print('Installation finished') +subprocess.run('python main.py') #to run the main.py file \ No newline at end of file From 976cfc5ee73468714ed310425644da97107f60b2 Mon Sep 17 00:00:00 2001 From: Pagasis <74396469+Pagasis@users.noreply.github.com> Date: Mon, 1 Nov 2021 11:31:02 +0530 Subject: [PATCH 2/3] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 76b0e8a..d375219 100644 --- a/setup.py +++ b/setup.py @@ -49,4 +49,4 @@ def setup(module_name): for package in package_q: #sending module names to the setup_a funtion setup(package) print('Installation finished') -subprocess.run('python main.py') #to run the main.py file \ No newline at end of file +subprocess.run('python YouTua.py') #to run the main.py file From edb44b2065a7224f8b26aaf76166bf7287901567 Mon Sep 17 00:00:00 2001 From: Pagasis <74396469+Pagasis@users.noreply.github.com> Date: Mon, 1 Nov 2021 11:32:38 +0530 Subject: [PATCH 3/3] Update README.md --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3476e18..ec73843 100644 --- a/README.md +++ b/README.md @@ -43,10 +43,11 @@ YouTua is a GUI Program to download videos/playlists from various [supported sit git clone https://github.com/dhhruv/YouTua.git ``` -3. Run YouTua +3. Run setup.py ``` -python YouTua.py +python setup.py ``` +This will install required packages and run `YouTua.py` **You've to download [ffmpeg](https://ffmpeg.org/download.html) to run it manually.**
**OR**
@@ -65,4 +66,4 @@ python YouTua.py

One of the best features of YouTua is that you can Resume your download if it was interrupted. To resume your interrupted download, apply the same preferences of Output Folder, Format and Quality and Done. Enjoy !!

-

Made with ❤ by Dhruv Panchal

\ No newline at end of file +

Made with ❤ by Dhruv Panchal