karim0209

termux-url-opener 11-10-2020

Oct 10th, 2020
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 7.78 KB | None | 0 0
  1. #!/data/data/com.termux/files/usr/bin/bash
  2. echo "File download best video file   press 0"
  3. echo "For instagram photos rang download    press 1"
  4. echo "For  single  Audio   file     only    press 2"
  5. echo "File download video files in Folder   press 3"
  6. echo "For Audio playlist items    in folder press 4"
  7. echo "File download using     Wget          press 5"
  8. echo "File download using     Aria2c        press 6"
  9. echo "For Audio cut using     ffmpeg        press 7"
  10. echo "for item files in folder for playlist press 8"
  11. echo "For Download     instagram    photos  press 9"
  12. echo "For Download    instagram photo item  press 10"
  13. echo "For Download     spotify playlist     press 11"
  14. echo "For Download     spotify    songs     press 12"
  15. echo "For Download     spotify       Album  press 13"
  16. echo "For gdrivedl    download g    file    press 14"
  17. echo "For url mp3 file download using arial press 15"
  18. echo "For AIR mp3 file download using arial press 16"
  19. echo "For gdrivedl    download g    file    press 17"
  20. echo "For .pdf file download using arial press 18"
  21. echo "For all pdf files in a url download using arial press 19"
  22.  
  23. command="--embed-thumbnail --no-part --no-warnings --no-mtime -o '/data/data/com.termux/files/home/storage/shared/Youtube/%(title)s -- %(uploader)s.%(ext)s' -i --external-downloader aria2c --external-downloader-args '-c -x 16 -s 16 -k 1M --file-allocation=none'"
  24. command1="--embed-thumbnail --no-part --no-warnings --no-mtime -o '/data/data/com.termux/files/home/storage/shared/Youtube/%(title)s -- %(uploader)s.%(ext)s' -i"
  25. folder="--embed-thumbnail --no-part --no-warnings --no-mtime -o '/data/data/com.termux/files/home/storage/shared/Youtube/%(playlist)s/%(title)s -- %(uploader)s.%(ext)s' -i --external-downloader aria2c --external-downloader-args '-c -x 16 -s 16 -k 1M --file-allocation=none'"
  26. downloader="--external-downloader aria2c --external-downloader-args '-c -x 16 -s 16 -k 1M --file-allocation=none'"
  27. darial="aria2c -n -c -x 16 -s 16 -k 1M"
  28. read option
  29.  
  30. if [ "$option" -eq "0" ]
  31. then
  32.     echo "$command -f best" > ~/.config/youtube-dl/config
  33.     youtube-dl $1
  34.  
  35. elif [ "$option" -eq "1" ]
  36. then
  37.     echo -e "Enter range u want example 1-14,3,7-22"
  38.     read num
  39.     gallery-dl -d storage/shared/gallery --range $num $1
  40. elif [ "$option" -eq "2" ]
  41. then
  42.     echo "$command -f 140 " > ~/.config/youtube-dl/config
  43.     youtube-dl $1
  44.  
  45. elif [ "$option" -eq "3" ]
  46. then
  47.     echo -e "Available Video formats \n"
  48.     youtube-dl $1
  49.     echo -e "Enter video+audio format \n"
  50.     read num
  51.     echo -e "Enter Playlist Number You want to items \n"
  52.     read items
  53.     echo "$folder -f $num --playlist-items $items" > ~/.config/youtube-dl/config
  54.     youtube-dl $1
  55. elif [ "$option" -eq "4" ]
  56. then
  57.     echo -e "Enter Playlist items You want \n"
  58.     read items
  59.     echo "$folder -f 140  --playlist-items $items" > ~/.config/youtube-dl/config
  60.     youtube-dl $1
  61. elif [ "$option" -eq "5" ]
  62. then
  63.     echo "-V -O" > ~/.config/youtube-dl/config
  64.     wget -c $1 -P '/data/data/com.termux/files/home/storage/shared/Youtube'
  65. elif [ "$option" -eq "6" ]
  66. then
  67.     echo "-c -x 16 -s 16 -k 1M" > ~/.config/youtube-dl/config
  68.     aria2c $1 --file-allocation=none -d '/data/data/com.termux/files/home/storage/shared/Youtube'
  69. elif [ "$option" -eq "7" ]
  70. then
  71.     echo -e "Enter start time \n"
  72.     read start
  73.     echo -e "Enter end time duration\n"
  74.     read end
  75.     echo -e "Enter output file name \n"
  76.     read name
  77.     echo "-g -f 140" > ~/.config/youtube-dl/config
  78.     cd ~/storage/shared/Youtube
  79.     ffmpeg -i $(youtube-dl $1) -ss $start -t $end -c copy $name
  80. elif [ "$option" -eq "8" ]
  81. then
  82.     echo -e "Available formates \n"
  83.     youtube-dl -F $1
  84.     echo -e "Enter formates like 136+249 \n"
  85.     read format
  86.     echo -e "Enter Playlist Number You want to items \n"
  87.     read items
  88.     echo -e "$downloader  --no-part --no-mtime -o '/data/data/com.termux/files/home/storage/shared/Youtube/%(playlist)s/%(title)s.%(ext)s' -i -f $format --playlist-items $items" > ~/.config/youtube-dl/config
  89.     youtube-dl $1
  90. elif [ "$option" -eq "9" ]
  91. then
  92.     echo -e "Downloading photos .... \n"
  93.     gallery-dl -d '~/storage/shared/gallery' $1 | grep -o 'https*://[^?]*'
  94. elif [ "$option" -eq "10" ]
  95. then
  96.     echo -e "Enter specifying which images to download. For example '5-10' or '1,3-5 ... \n"
  97.     read num
  98.     echo -e "Downloading photos .... \n"
  99.     gallery-dl -d '~/storage/shared/gallery' --range $num $1 | grep -o 'https*://[^?]*'
  100.     echo $1 | grep -o 'https*://[^?]*'
  101.     sleep 20
  102. elif [ "$option" -eq "11" ]
  103. then
  104.     cd /data/data/com.termux/files/home/storage/shared/spotify-music
  105.     echo -e "please wait Downloading playlist text file.... \n"
  106.     spotdl -p $1 && pwd && ls
  107.     echo -e "please wait moving .txt file in folder \n"
  108.     read fname
  109.     mkdir $fname-$(echo "$(date)" | sed 's, ,-,g')
  110.     mv *.txt $fname-*
  111.     cd $fname-* && pwd && ls
  112.     echo -e "Type playlist name only without extention  \n"
  113.     read file
  114.     spotdl -l $file.txt && rm *.txt
  115. elif [ "$option" -eq "12" ]
  116. then
  117.     echo -e "Please wait Downloading spotify song...\n"
  118.     cd storage/shared/spotify-music && ls
  119.     echo "" > ~/.config/youtube-dl/config
  120.     spotdl -s $1
  121. elif [ "$option" -eq "13" ]
  122. then
  123.     echo -e "please wait Downloading Album text file.... \n"
  124.     spotdl -b $1 && ls
  125.     echo -e "Type folder name and album name  \n"
  126.     read fname file
  127.     echo "-l" > ~/.config/youtube-dl/config
  128.     spotdl -f storage/shared/spotify-music/$fname -l $file
  129. elif [ "$option" -eq "14" ]
  130. then
  131.      cd ~/storage/shared/Youtube && ls && gdrivedl $1
  132. elif [ "$option" -eq "15" ]
  133. then
  134.     cd /data/data/com.termux/files/home/storage/shared/youtube
  135.     ls
  136.     echo -e "please wait mp3 file downloading.... \n"
  137.     aria2c -c -x 16 -s 16 -k 1M $(lynx -listonly -nonumbers -dump $1 | grep mp3)
  138.     ls
  139. elif [ "$option" -eq "16" ]
  140. then
  141.     cd /data/data/com.termux/files/home/storage/shared/youtube
  142.     ls
  143.     echo -e "please wait mp3 file downloading.... \n"
  144.     aria2c -c -x 16 -s 16 -k 1M $1
  145.     ls
  146. elif [ "$option" -eq "17" ]
  147. then
  148.      cd ~/storage/shared/Youtube && ls && gdrivedl $(lynx -listonly -nonumbers -dump $1 | grep drive)
  149. elif [ "$option" -eq "18" ]
  150. then
  151.     cd /data/data/com.termux/files/home/storage/shared/Study-Materials
  152.     ls
  153.     echo -e "please wait creating directory"
  154.     mkdir $(echo "$(date +%d-%A-%m-%B-%Y-%X%P)" | sed 's, ,-,g')
  155.     ls
  156.     echo -e "Entering Into the creating directory"
  157.     read folder
  158.     cd $folder
  159.     echo -e "please wait .pdf file downloading.... \n"
  160.     aria2c -c -x 16 -s 16 -k 1M $(lynx -listonly -nonumbers -dump $1 | grep .pdf )
  161. elif [ "$option" -eq "19" ]
  162. then
  163.     cd /data/data/com.termux/files/home/storage/shared/Study-Materials
  164.     ls
  165.     echo -e "please wait creating directory"
  166.     mkdir $(echo "$(date +%d-%A-%m-%B-%Y-%X%P)" | sed 's, ,-,g')
  167.     ls
  168.     echo -e "Entering Into the creating directory"
  169.     read folder
  170.     cd $folder
  171.     echo -e "Enter url contain direct pdf files 1"
  172.     echo -e "Enter url contain next level web page pdf file 2"
  173.     read opt
  174.     if [ "$opt" -eq "1" ]
  175.     then
  176.     lynx -listonly -nonumbers -dump $1
  177.     echo -e "Enter links to extract name and enter .txt file name like link name\n"
  178.     read link name
  179.     lynx -listonly -nonumbers -dump $1 | grep $link > $name.txt
  180.     echo -e "please wait .pdf file downloading.... \n"
  181.     while read file;do aria2c -c -x 16 -s 16 -k 1M $file;done < $name.txt
  182.     elif [ "$opt" -eq "2" ]
  183.     then
  184.     lynx -listonly -nonumbers -dump $1
  185.     echo -e "Enter links to extract name and enter .txt file name like link name\n"
  186.     read link name
  187.     lynx -listonly -nonumbers -dump $1 | grep $link > $name.txt
  188.     echo -e "please wait .pdf file downloading.... \n"
  189.     while read file;do aria2c -c -x 16 -s 16 -k 1M $(lynx -listonly -nonumbers -dump $file | grep .pdf );done < $name.txt
  190.     fi
  191. fi
  192.  
Add Comment
Please, Sign In to add comment