├── config ├── termux-file-editor ├── config.yml ├── termux-url-opener ├── setup.sh ├── README.md └── CODE_OF_CONDUCT.md /config: -------------------------------------------------------------------------------- 1 | 2 | --no-mtime -o /data/data/com.termux/files/home/storage/shared/Youtube-downloads/%(title)s.%(ext)s -f "best[height<=1080]" 3 | 4 | -------------------------------------------------------------------------------- /termux-file-editor: -------------------------------------------------------------------------------- 1 | #!/data/data/com.termux/files/usr/bin/bash 2 | 3 | URL=$(sed -n 2p $1) 4 | ~/bin/termux-url-opener $URL 5 | 6 | #clean 7 | rm tempfile 8 | rm $1 9 | -------------------------------------------------------------------------------- /config.yml: -------------------------------------------------------------------------------- 1 | spotify-downloader: 2 | dry_run: false 3 | input_ext: automatic 4 | log_level: INFO 5 | manual: false 6 | no_encode: false 7 | no_metadata: false 8 | no_spaces: false 9 | output_ext: mp3 10 | output_file: storage/music/{artist} - {track-name}.{output-ext} 11 | overwrite: prompt 12 | quality: best 13 | search_format: '{artist} - {track-name} lyrics' 14 | skip_file: null 15 | spotify_client_id: 4fe3fecfe5334023a1472516cc99d805 16 | spotify_client_secret: 0f02b7c483c04257984695007a4a8d5c 17 | trim_silence: false 18 | write_successful_file: null 19 | write_to: 20 | -------------------------------------------------------------------------------- /termux-url-opener: -------------------------------------------------------------------------------- 1 | #!/data/data/com.termux/files/usr/bin/bash 2 | 3 | # Get the URL 4 | URL=$1 5 | echo "Opening URL" 6 | 7 | # Cheks if its Youtube or Spotify URL and downloads it 8 | if [[ $URL == *"open.spotify.com"* ]] ; then 9 | echo "Spotify link detected" 10 | if [[ $URL == *"playlist"* ]]; then 11 | echo "Downloading Playlist" 12 | spotdl --playlist $URL --write-to playlist.txt 13 | spotdl --list playlist.txt 14 | rm -rf playlist.txt 15 | fi 16 | if [[ $URL == *"track"* ]]; then 17 | echo "Downloading Song" 18 | spotdl --song $URL 19 | fi 20 | if [[ $URL == *"album"* ]]; then 21 | echo "Downloading Album" 22 | spotdl --album $URL --write-to album.txt 23 | spotdl --list album.txt 24 | rm -rf album.txt 25 | fi 26 | elif [[ $URL == *"youtu.be"* || $URL == *"youtube.com"* ]]; then 27 | formatvar=0 28 | read -p $'What do you want to download \n(Select the number and press enter) \n 1) Video \n 2) Audio \n' formatvar 29 | if [[ $formatvar == 1 ]]; then 30 | read -p $'Do you want to download the subtitles for this video? \n(Select the number and press enter) \n 1) Yes \n 2) No \n' formatvar 31 | if [[ $formatvar == 1 ]]; then 32 | echo 'Downloading Video with subtitles' 33 | youtube-dl --all-subs $URL 34 | elif [[ $formatvar == 2 ]]; then 35 | echo 'Downloading Video' 36 | youtube-dl $URL 37 | fi 38 | elif [[ $formatvar == 2 ]]; then 39 | echo 'downloading Audio' 40 | youtube-dl -x --audio-format 'mp3' $URL 41 | else 42 | echo 'Default downloading Video' 43 | youtube-dl $URL 44 | fi 45 | 46 | else 47 | echo "No downloader for this URL type" 48 | fi 49 | 50 | read -n 1 -s -p "Press any key to exit..." 51 | -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | #!/data/data/com.termux/files/usr/bin/bash 2 | 3 | termux-setup-storage 4 | #Asks for storage permissions 5 | 6 | sleep 5s 7 | apt update && apt upgrade -y 8 | #Updates and upgrades termux packages 9 | 10 | pkg install python ffmpeg -y 11 | #Installs python 12 | 13 | pip install youtube-dl 14 | pip3 install spotdl 15 | #Installs youtube-dl and spotdl 16 | 17 | #~Starts Youtube-dl configuration~ 18 | 19 | if [[ ! -d /data/data/com.termux/files/home/storage/shared/Youtube-downloads ]]; then 20 | mkdir /data/data/com.termux/files/home/storage/shared/Youtube-downloads 21 | fi 22 | #Creates folder where the videos will be downloaded 23 | 24 | if [[ ! -d ~/.config/youtube-dl ]]; then 25 | mkdir -p ~/.config/youtube-dl 26 | fi 27 | #Creates youtube-dl config folder 28 | 29 | cp config ~/.config/youtube-dl 30 | #Creates config file for youtube-dl 31 | 32 | #~Ends Youtube-dl configuration~ 33 | 34 | #~Starts spotdl configuration~ 35 | 36 | 37 | if [[ ! -d /data/data/com.termux/files/home/storage/shared/Music ]]; then 38 | mkdir /data/data/com.termux/files/home/storage/shared/Music 39 | fi 40 | #Creates folder where the music will be downloaded 41 | 42 | if [[ -e /data/data/com.termux/files/home/.config/spotdl/config.yml ]]; then 43 | mv ~/.config/spotdl/config.yml ~/.config/spotdl/config.backup 44 | fi 45 | 46 | if [[ ! -d /data/data/com.termux/files/home/.config/spotdl ]]; then 47 | mkdir /data/data/com.termux/files/home/.config/spotdl 48 | fi 49 | 50 | 51 | cp config.yml ~/.config/spotdl/config.yml 52 | 53 | #~Ends spotdl configuration~ 54 | 55 | if [[ ! -d ~/bin ]]; then 56 | mkdir ~/bin 57 | fi 58 | #Creates bin folder for termux-url-opener and termux-file-editor if doesn't exists 59 | 60 | if [[ -e ~/bin/termux-url-opener ]]; then 61 | rm ~/bin/termux-url-opener 62 | fi 63 | 64 | cp termux-url-opener ~/bin 65 | chmod +x ~/bin/termux-url-opener 66 | cp termux-file-editor ~/bin 67 | chmod +x ~/bin/termux-file-editor 68 | 69 | echo "Downloading test video" 70 | youtube-dl https://www.youtube.com/watch?v=dQw4w9WgXcQ 71 | #Downloads Rick Astley's Never gonna Give you Up video 72 | 73 | echo "..." 74 | echo "Downloading test song" 75 | spotdl --song https://open.spotify.com/track/4uLU6hMCjMI75M1A2tKUQC?si=dLH5xrYaT_CX4RJ3sfFpvA 76 | #Downloads Rick Astley's Never gonna Give you Up song 77 | 78 | echo "..." 79 | echo "Everything should be working now" 80 | echo "Have fun!" 81 | read -n 1 -s -p "Press any key to exit..." 82 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # youtify 2 | 3 | DEPRECATED 4 | 5 | This is no longer working due to changes in the depending libraries, I will make an up to date veesion when I have some time. 6 | Feel free to contact or make your own version. 7 | email: rimoliga@gmail.comwt 8 | 9 | 10 | 11 | 12 | 13 | 14 | Installs and configures youtube-dl and spotdl for music and videos downloading in android termux 15 | 16 | **_(You can buy me a coffe donating with BAT using Brave browser You can also 🌟 this repo)_** 17 | 18 | You can simply install this downloader by copy an pasting the next lines of code after a clean termux install (you can install it after installing other programs or repositories but I don garantize it to work): 19 | ``` 20 | pkg install git -y 21 | git clone https://github.com/gabosxpiens/youtify.git 22 | cd youtify 23 | chmod +x setup.sh 24 | ./setup.sh && exit 25 | ``` 26 | **Instructions of use** 27 | 28 | 29 | After installing you can go to any youtube video or spotify song and share it in the app to termux, after finishing downloading the video will be in your internal storage inside the folder "Youtube-downloads" and the songs in "Music" folder. 30 | 31 | 32 | This script uses spotdl ( https://github.com/ritiek/spotify-downloader ) 33 | 34 | To share songs, albums and playlist from spotify you will se somtehing like the next image: 35 | 36 | ![alt text](https://i.imgur.com/aSEIGCy.jpg) 37 | 38 | Write anything you want and press enter (This creates a file that will be automatically deleted) 39 | 40 | ![alt text](https://i.imgur.com/093zkht.jpg) 41 | 42 | ![alt text](https://i.imgur.com/AJQCXx7.jpg) 43 | 44 | Now you can download Youtube videos with subtitles! 45 | (Vlc player recommended for subs) 46 | 47 | ![alt text](https://i.imgur.com/YGi5K8F.jpg) 48 | 49 | ![alt text](https://i.imgur.com/tLGItLI.jpg) 50 | 51 | ![alt text](https://i.imgur.com/hMmpipL.jpg) 52 | 53 | 54 | **Problems** 55 | 56 | This was partialy solved, you can write any (non-empty) filename an press enter. Any help to skip the "Save file in ~/donwloads/" message will be welcome. 57 | 58 | In some versions of the Spotify app when you share a song to termux, spotify shares a text like "Here is a song for you (song link)". This makes the termux-url-opener fail because termux doesn't recognize this as a link and displays a window that says something like "Save file in ~/downloads". 59 | 60 | I'm trying to fix this but at the moment this config is not working with the latest spotify version (8.5.43.724 01/29/2020). 61 | You can still download the spotify song using spotdl and the link of the spotify song. For this when sharing in spotify select "copy link" and then go to termux and write: 62 | 63 | spotdl -s (Paste shared link here) 64 | 65 | This will download the song in the Music folder on the internal storage 66 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at rimoliga@gmail.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | --------------------------------------------------------------------------------