karim0209

termux-url-opener 31102020

Oct 31st, 2020 (edited)
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 9.47 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. echo "For Audio playlist of channel   in folder press 20"
  23. echo "download using THAu  press 21"
  24.  
  25. 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'"
  26. 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"
  27. 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'"
  28. downloader="--external-downloader aria2c --external-downloader-args '-c -x 16 -s 16 -k 1M --file-allocation=none'"
  29. Grange="-d storage/shared/Gallery --range"
  30. Gl="-d storage/shared/Gallery"
  31. read option
  32.  
  33. if [ "$option" -eq "0" ]
  34. then
  35.     echo "$command -f best" > ~/.config/youtube-dl/config
  36.     youtube-dl $1
  37.  
  38. elif [ "$option" -eq "1" ]
  39. then
  40.     echo -e "Enter range u want example 1-14,3,7-22"
  41.     read num
  42.     gallery-dl $Grange $num $1 | sed 's,/?igshid=.*,,g'
  43. elif [ "$option" -eq "2" ]
  44. then
  45.     echo "$command -f 140 " > ~/.config/youtube-dl/config
  46.     youtube-dl $1
  47.  
  48. elif [ "$option" -eq "3" ]
  49. then
  50.     echo -e "Enter Playlist Number You want to items \n"
  51.     read items
  52.     echo "$folder -f best --playlist-items $items" > ~/.config/youtube-dl/config
  53.     youtube-dl $1
  54. elif [ "$option" -eq "4" ]
  55. then
  56.     echo -e "You want Youtube audio    press 1 \n"
  57.     echo -e "You want Soundcloud audio press 2 \n"
  58.     read opt
  59.     if [ "$opt" -eq "1" ]
  60.     then
  61.     echo -e "Enter Playlist items You want \n"
  62.     read items
  63.     echo "$folder -f 140  --playlist-items $items" > ~/.config/youtube-dl/config
  64.     youtube-dl $1
  65.     elif [ "$opt" -eq "2" ]
  66.     then
  67.     echo -e "Enter Playlist items You want \n"
  68.     read items
  69.     echo "$folder -f hls_mp3_128 --playlist-items $items" > ~/.config/youtube-dl/config
  70.     youtube-dl $1
  71.     fi
  72. elif [ "$option" -eq "5" ]
  73. then
  74.     echo "-V -O" > ~/.config/youtube-dl/config
  75.     wget -c $1 -P '/data/data/com.termux/files/home/storage/shared/Youtube'
  76. elif [ "$option" -eq "6" ]
  77. then
  78.     echo "-c -x 16 -s 16 -k 1M" > ~/.config/youtube-dl/config
  79.     aria2c $1 --file-allocation=none -d '/data/data/com.termux/files/home/storage/shared/Youtube'
  80. elif [ "$option" -eq "7" ]
  81. then
  82.     echo -e "Enter start time \n"
  83.     read start
  84.     echo -e "Enter end time duration\n"
  85.     read end
  86.     echo -e "Enter output file name \n"
  87.     read name
  88.     echo "-g -f 140" > ~/.config/youtube-dl/config
  89.     cd ~/storage/shared/Youtube
  90.     ffmpeg -i $(youtube-dl $1) -ss $start -t $end -c copy $name
  91. elif [ "$option" -eq "8" ]
  92. then
  93.     echo -e "Available formates \n"
  94.     youtube-dl -F $1
  95.     echo -e "Enter formates like 136+249 \n"
  96.     read format
  97.     echo -e "Enter Playlist Number You want to items \n"
  98.     read items
  99.     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
  100.     youtube-dl $1
  101. elif [ "$option" -eq "9" ]
  102. then
  103.     echo -e "Downloading photos .... \n"
  104.     gallery-dl $Gl $1 | sed 's,/?igshid=.*,,g'
  105. elif [ "$option" -eq "10" ]
  106. then
  107.     echo -e "Enter specifying which images to download. For example '5-10' or '1,3-5 ... \n"
  108.     read num
  109.     echo -e "Downloading photos .... \n"
  110.     gallery-dl $Grange $num $1 | sed 's,/?igshid=.*,,g'
  111. elif [ "$option" -eq "11" ]
  112. then
  113.     cd /data/data/com.termux/files/home/storage/shared/spotify-music
  114.     echo -e "please wait Downloading playlist text file.... \n"
  115.     spotdl -p $1 && pwd && ls
  116.     echo -e "please Enter moving .txt file in folder \n"
  117.     read fname
  118.     mkdir $fname-$(echo "$(date +%A%d-%B-%Y-Time-%I-%M)")
  119.     mv *.txt $fname-*
  120.     cd $fname-* && pwd && ls
  121.     echo -e "Type playlist name only without extention  \n"
  122.     read file
  123.     spotdl -l $file.txt && rm *.txt
  124. elif [ "$option" -eq "12" ]
  125. then
  126.     echo -e "Please wait Downloading spotify song...\n"
  127.     cd storage/shared/spotify-music && ls
  128.     echo "" > ~/.config/youtube-dl/config
  129.     spotdl -s $1
  130. elif [ "$option" -eq "13" ]
  131. then
  132.     cd /data/data/com.termux/files/home/storage/shared/spotify-music
  133.     echo -e "please wait Downloading Album text file.... \n"
  134.     spotdl -a $1 && ls
  135.     echo -e "please Enter moving .txt file in folder \n"
  136.     read fname
  137.     mkdir $fname-$(echo "$(date +%A%d-%B-%Y-Time-%I-%M)")
  138.     mv *.txt $fname-*
  139.     cd $fname-* && pwd && ls
  140.     echo -e "Type playlist name only without extention  \n"
  141.     read file
  142.     spotdl -l $file.txt && rm *.txt
  143. elif [ "$option" -eq "14" ]
  144. then
  145.      cd ~/storage/shared/Youtube && ls && gdrivedl $1
  146. elif [ "$option" -eq "15" ]
  147. then
  148.     cd /data/data/com.termux/files/home/storage/shared/youtube
  149.     ls
  150.     echo -e "please wait mp3 file downloading.... \n"
  151.     aria2c -c -x 16 -s 16 -k 1M $(lynx -listonly -nonumbers -dump $1 | grep mp3)
  152.     ls
  153. elif [ "$option" -eq "16" ]
  154. then
  155.     cd /data/data/com.termux/files/home/storage/shared/AIR
  156.     ls
  157.     echo -e "please wait mp3 file downloading.... \n"
  158.     aria2c -c -x 16 -s 16 -k 1M $1
  159.     ls
  160. elif [ "$option" -eq "17" ]
  161. then
  162.      cd ~/storage/shared/Youtube && ls && gdrivedl $(lynx -listonly -nonumbers -dump $1 | grep drive)
  163. elif [ "$option" -eq "18" ]
  164. then
  165.     cd /data/data/com.termux/files/home/storage/shared/Study-Materials
  166.     ls
  167.     echo -e "please wait creating directory"
  168.     mkdir $(echo "$(date +%d-%A-%m-%B-%Y-%X%P)" | sed 's, ,-,g')
  169.     ls
  170.     echo -e "Entering Into the creating directory"
  171.     read folder
  172.     cd $folder
  173.     echo -e "please wait .pdf file downloading.... \n"
  174.     aria2c -c -x 16 -s 16 -k 1M $(lynx -listonly -nonumbers -dump $1 | grep .pdf )
  175. elif [ "$option" -eq "19" ]
  176. then
  177.     cd /data/data/com.termux/files/home/storage/shared/Study-Materials
  178.     ls
  179.     echo -e "Enter folder name u want please wait creating directory"
  180.     read fname
  181.     mkdir $fname-$(echo "$(date +%d-%A-%m-%B-%Y-%X%P)" | sed 's, ,-,g')
  182.     cd $fname-*
  183.     pwd
  184.     ls
  185.     echo -e "Enter url contain direct pdf files in gdrive 0"
  186.     echo -e "Enter url contain direct pdf files 1"
  187.     echo -e "Enter url contain next level web page pdf file 2"
  188.     read opt
  189.     if [ "$opt" -eq "0" ]
  190.     then
  191.     lynx -listonly -nonumbers -dump $1
  192.     echo -e "Enter links to extract name and enter .txt file name like link name\n"
  193.     read link name
  194.     lynx -listonly -nonumbers -dump $1 | grep $link > $name.txt
  195.     echo -e "please wait .pdf files downloading gdrivedl.... \n"
  196.     while read file;do gdrivedl $file;done < $name.txt
  197.     elif [ "$opt" -eq "1" ]
  198.     then
  199.     lynx -listonly -nonumbers -dump $1
  200.     echo -e "Enter links to extract name and enter .txt file name like link name\n"
  201.     read link name
  202.     lynx -listonly -nonumbers -dump $1 | grep $link > $name.txt
  203.     echo -e "please wait .pdf file downloading.... \n"
  204.     while read file;do aria2c -c -x 16 -s 16 -k 1M $file;done < $name.txt
  205.     elif [ "$opt" -eq "2" ]
  206.     then
  207.     lynx -listonly -nonumbers -dump $1
  208.     echo -e "Enter links to extract name and enter .txt file name like link name\n"
  209.     read link name
  210.     lynx -listonly -nonumbers -dump $1 | grep $link > $name.txt
  211.     echo -e "please wait .pdf file downloading.... \n"
  212.     while read file;do aria2c -c -x 16 -s 16 -k 1M $(lynx -listonly -nonumbers -dump $file | grep .pdf );done < $name.txt
  213.     fi
  214. elif [ "$option" -eq "20" ]
  215. then
  216.     echo "$folder --yes-playlist -f 140" > ~/.config/youtube-dl/config
  217.     youtube-dl $1
  218. elif [ "$option" -eq "21" ]
  219. then
  220.     cd ~/storage/shared/Study-Materials/The\ Hindu\ Articles\ txt\ mp3/;ls
  221.     echo -e "$pwd\n Downloading web content ...."
  222.     ls
  223.     echo -e "paste here your single url"
  224.     THAu
  225.     echo -e "your single url data downloaded"
  226.     sleep 3
  227. fi
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235. #elif [ "$option" -eq "21" ]
  236. #then
  237. #    cd /data/data/com.termux/files/home/storage/shared/Study-Materials
  238. #    ls
  239. #    echo -e "Downloading web content ...."
  240. #    TheHinduArticle > $(touch $(echo "$(date +%A%d-%B-%Y-Time-%I-%M).txt"))
  241. #    txt2pdf --font /data/data/com.termux/files/home/DroidSerif-Regular.ttf $(echo "$(date +%A%d--%B-%Y-Time-%I-%M).txt") -o $(echo "$(date +%A%d-%B-%Y-Time-%I-%M).pdf")
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
Add Comment
Please, Sign In to add comment