- Pull this repository using the command
git pull https://github.com/Aadeshp/Youtube-Search.git - Change directory into the folder:
cd Youtube-Search - Move the script inside the folder to the local bin folder:
mv youtube.py ~/bin/(If you do not have a local bin folder, follow the steps under Set Up Bin - Change directory to the local bin folder
- Run the command
lsto double check that the fileyoutube.pyis in the bin folder, if not retrace your steps - Now you need to add the executable permission to the script, so run the command
chmod +x ~/bin/youtube.py - Now you can use
youtube.pyas a command (For help on how to use it runyoutube.py -h - OPTIONAL: Instead of having to run the command
youtube.py [OPTION] [ARGUMENT], you can get rid of the .py extension by changing directory into the local bin foldercd ~/binand changing the name of the script with the commandmv youtube.py youtube. Now you can run the command asyoutube [OPTION] [ARGUMENT]
- Create a local bin folder:
mkdir ~/bin - Open up either .bashrc or .bash_profile (Depending on Machine) in a text editor:
vim ~/.bashrcorvim ~/.bash_profile - Add
PATH=$PATH:$HOME/binat the top of the file and save - Now run the command
source ~/.bashrcorsource ~/.bash_profile(Depending on which you used from step 2) - Now run the command
$PATHto double check that your local bin folder is now in $PATH
Below I will briefly explain how to use this script and the types of arguments:
Positional (Mandatory) Argument(s):
- Search
youtube.py [SEARCH TEXT]([SEARCH TEXT]would be your search text surrounded by QUOTES) - This will open up the youtube video search page with the provided SEARCH TEXT
Optional Argument(s):
youtube.py "SEARCH TEXT" --upload-date [DATE ARG]ORyoutube.py "SEARCH TEXT" -u [DATE ARG]- This will do the same as the above command, except it will add the filter for Upload Date. Below are appropriate arguments to replace the[DATE ARG]placeholder- hour
- today
- week
- month
- year
- For Additional Options/Filters, run the command
youtube.py -h