Advertisement
karim0209

07122022 Termux-url-opener

Dec 6th, 2022
1,843
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 11.61 KB | None | 0 0
  1. #!/data/data/com.termux/files/usr/bin/bash
  2. export XDG_RUNTIME_DIR='/data/data/com.termux/files/usr/tmp/runtime-u0_a547'
  3. export RUNLEVEL=3
  4. echo "File download movie video code 18 file press 00"
  5. echo "For Audio playlist items    in folder press 111"
  6. echo "File download best video file   press 0"
  7. echo "File download best short video file   press 99"
  8. echo "For instagram photos rang download    press 1"
  9. echo "For  single  Audio   file in JukeBox press 2"
  10. echo "File download video files in Folder   press 3"
  11. echo "For Audio playlist items    in folder press 4"
  12. echo "File download using     Wget          press 5"
  13. echo "File download using     Aria2c        press 6"
  14. echo "For Audio cut using     ffmpeg        press 7"
  15. echo "for item files in folder for playlist press 8"
  16. echo "For Download     instagram    photos  press 9"
  17. echo "For Download    instagram photo item  press 10"
  18. echo "For Download Dristi IAS Day News  pdf press 11"
  19. echo "For Download     spotify    songs     press 12"
  20. echo "For Download     spotify       Album  press 13"
  21. echo "For gdrivedl    download g    file    press 14"
  22. echo "For url mp3 file download using arial press 15"
  23. echo "For AIR mp3 file download using arial press 16"
  24. echo "For gdrivedl    download g    file    press 17"
  25. echo "For .pdf file download using arial press 18"
  26. echo "For all pdf files in a url download using arial press 19"
  27. echo "For Audio playlist of channel   in folder press 20"
  28. echo "download using THAu&Fino press 21"
  29. echo "Download .m4a file in Dristi Topics press 22"
  30. echo "download using THAu press 23"
  31.  
  32. command="--embed-thumbnail --no-part --no-warnings --no-mtime -o '/data/data/com.termux/files/home/storage/shared/JukeBox/%(title)s -- %(uploader)s.%(ext)s' -i --external-downloader aria2c --external-downloader-args '-c -x 16 -s 16 -k 1M --file-allocation=none'"
  33. dfol="--embed-thumbnail --no-part --no-warnings --no-mtime -o '/data/data/com.termux/files/home/storage/shared/StudyMaterials/DristiIASm4a/%(title)s.%(ext)s' -i"
  34. command1="--embed-thumbnail --no-part --no-warnings --no-mtime -o '/data/data/com.termux/files/home/storage/shared/JukeBox/%(title)s -- %(uploader)s.%(ext)s' -i"
  35. folder="--embed-thumbnail --no-part --no-warnings --no-mtime -o '/data/data/com.termux/files/home/storage/shared/JukeBox/%(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'"
  36. dloader="--external-downloader aria2c --external-downloader-args '-c -x 16 -s 16 -k 1M --file-allocation=none'"
  37. Grange="--dest ~/storage/shared/Gallery --range"
  38. Gl="--dest ~/storage/shared/Gallery"
  39. read option
  40.  
  41. if [ "$option" -eq "00" ]
  42. then
  43.     echo "$command -f 18" > ~/.config/youtube-dl/config
  44.     youtube-dl $1
  45.  
  46. elif [ "$option" -eq "111" ]
  47. then
  48.     echo -e "Enter Playlist items You want \n"
  49.     read items
  50.     echo "$folder -f 140  --playlist-items $items" > ~/.config/youtube-dl/config
  51.     youtube-dl $1
  52.  
  53. elif [ "$option" -eq "0" ]
  54. then
  55.     echo "$command -f best" > ~/.config/youtube-dl/config
  56.     youtube-dl $1
  57.  
  58. elif [ "$option" -eq "99" ]
  59. then
  60.     echo $1 | sed 's,shorts/,watch?v=,g' | sed 's,?feature=share,,g'
  61.  
  62.     youtube-dl $(echo $1 | sed 's,shorts/,watch?v=,g' | sed 's,?feature=share,,g')
  63.  
  64. elif [ "$option" -eq "1" ]
  65. then
  66.     echo -e "Enter range u want just wait"
  67.     gallery-dl -d ~/storage/shared/Gallery $1 | sed 's,/?utm/_medium/=copy/_link,,g'
  68.  
  69. elif [ "$option" -eq "2" ]
  70. then
  71.     echo "$command -f 140 " > ~/.config/youtube-dl/config
  72.     youtube-dl $1
  73.  
  74. elif [ "$option" -eq "3" ]
  75. then
  76.     echo -e "You want Youtube best video Q press 1 \n"
  77.     echo -e "You want Youtube video code 18 Q press 2 \n"
  78.     read opt
  79.     if [ "$opt" -eq "1" ]
  80.     then
  81.     echo -e "Enter Playlist Number You want to items \n"
  82.     read items
  83.     echo "$folder -f best --playlist-items $items" > ~/.config/youtube-dl/config
  84.     youtube-dl $1
  85.     elif [ "$opt" -eq "2" ]
  86.     then
  87.     echo -e "Enter Playlist Number You want to items \n"
  88.     read items
  89.     echo "$folder -f 18 --playlist-items $items" > ~/.config/youtube-dl/config
  90.     youtube-dl $1
  91.     fi
  92. elif [ "$option" -eq "4" ]
  93. then
  94.     echo -e "You want Youtube audio    press 1 \n"
  95.     echo -e "You want Soundcloud audio press 2 \n"
  96.     read opt
  97.     if [ "$opt" -eq "1" ]
  98.     then
  99.     echo -e "Enter Playlist items You want \n"
  100.     read items
  101.     echo "$folder -f 140  --playlist-items $items" > ~/.config/youtube-dl/config
  102.     youtube-dl $1
  103.     elif [ "$opt" -eq "2" ]
  104.     then
  105.     echo -e "Enter Playlist items You want \n"
  106.     read items
  107.     echo "$folder -f hls_mp3_128 --playlist-items $items" > ~/.config/youtube-dl/config
  108.     youtube-dl $1
  109.     fi
  110. elif [ "$option" -eq "5" ]
  111. then
  112.     echo "-V -O" > ~/.config/youtube-dl/config
  113.     wget -c $1 -P '/data/data/com.termux/files/home/storage/shared/Youtube'
  114. elif [ "$option" -eq "6" ]
  115. then
  116.     echo "-c -x 16 -s 16 -k 1M" > ~/.config/youtube-dl/config
  117.     aria2c $1 --file-allocation=none -d '/data/data/com.termux/files/home/storage/shared/Youtube'
  118. elif [ "$option" -eq "7" ]
  119. then
  120.     echo -e "Enter start time \n"
  121.     read start
  122.     echo -e "Enter end time duration\n"
  123.     read end
  124.     echo -e "Enter output file name \n"
  125.     read name
  126.     echo "-g -f 140" > ~/.config/youtube-dl/config
  127.     cd ~/storage/shared/Youtube
  128.     ffmpeg -i $(youtube-dl $1) -ss $start -t $end -c copy $name
  129. elif [ "$option" -eq "8" ]
  130. then
  131.     echo -e "Available formates \n"
  132.     youtube-dl -F $1
  133.     echo -e "Enter formates like 136+249 \n"
  134.     read format
  135.     echo -e "Enter Playlist Number You want to items \n"
  136.     read items
  137.     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
  138.     youtube-dl $1
  139. elif [ "$option" -eq "9" ]
  140. then
  141.     echo -e "Downloading photos .... \n"
  142.     gallery-dl -u dkarimulla2011@gmail.com -p Allah@786 $Gl $1 | sed 's,/?igshid=.*,,g'
  143. elif [ "$option" -eq "10" ]
  144. then
  145.     echo -e "Enter specifying which images to download. For example '5-10' or '1,3-5 ... \n"
  146.     read num
  147.     echo -e "Downloading photos .... \n"
  148.     gallery-dl -u dkarimulla2011@gmail.com -p Allah@786 $Grange $num $1 | sed 's,/?igshid=.*,,g'
  149. elif [ "$option" -eq "11" ]
  150. then
  151.     echo -e "Please wait Downloading pdf...\n"
  152.     cd /data/data/com.termux/files/home/storage/shared/IAS/Dishti-News-Day-Wise;ls
  153.     wkhtmltopdf $1 $(echo $1 | sed 's,https://www.drishtiias.com/current-affairs-news-analysis-editorials/news-analysis/,,g' | sed 's,/print,,g').pdf
  154.     ls;sleep 07
  155. elif [ "$option" -eq "12" ]
  156. then
  157.     echo -e "Please wait Downloading spotify song...\n"
  158.     cd storage/shared/spotify-music && ls
  159.     echo "" > ~/.config/youtube-dl/config
  160.     spotdl -s $1
  161. elif [ "$option" -eq "13" ]
  162. then
  163.     cd /data/data/com.termux/files/home/storage/shared/spotify-music
  164.     echo -e "please wait Downloading Album text file.... \n"
  165.     spotdl -a $1 && ls
  166.     echo -e "please Enter moving .txt file in folder \n"
  167.     read fname
  168.     mkdir $fname-$(echo "$(date +%A%d-%B-%Y-Time-%I-%M)")
  169.     mv *.txt $fname-*
  170.     cd $fname-* && pwd && ls
  171.     echo -e "Type playlist name only without extention  \n"
  172.     read file
  173.     spotdl -l $file.txt && rm *.txt
  174. elif [ "$option" -eq "14" ]
  175. then
  176.      cd ~/storage/shared/Youtube && ls && gdrivedl $1
  177. elif [ "$option" -eq "15" ]
  178. then
  179.     cd /data/data/com.termux/files/home/storage/shared/youtube
  180.     ls
  181.     echo -e "please wait mp3 file downloading.... \n"
  182.     aria2c -c -x 16 -s 16 -k 1M $(lynx -listonly -nonumbers -dump $1 | grep mp3)
  183.     ls
  184. elif [ "$option" -eq "16" ]
  185. then
  186.     cd /data/data/com.termux/files/home/storage/shared/AIR
  187.     ls
  188.     echo -e "please wait mp3 file downloading.... \n"
  189.     aria2c -c -x 16 -s 16 -k 1M $1
  190.     ls
  191. elif [ "$option" -eq "17" ]
  192. then
  193.      cd ~/storage/shared/Youtube && ls && gdrivedl $(lynx -listonly -nonumbers -dump $1 | grep drive)
  194. elif [ "$option" -eq "18" ]
  195. then
  196.     cd /data/data/com.termux/files/home/storage/shared/Study-Materials
  197.     ls
  198.     echo -e "please wait creating directory"
  199.     mkdir $(echo "$(date +%d-%A-%m-%B-%Y-%X%P)" | sed 's, ,-,g')
  200.     ls
  201.     echo -e "Entering Into the creating directory"
  202.     read folder
  203.     cd $folder
  204.     echo -e "please wait .pdf file downloading.... \n"
  205.     aria2c -c -x 16 -s 16 -k 1M $(lynx -listonly -nonumbers -dump $1 | grep .pdf )
  206. elif [ "$option" -eq "19" ]
  207. then
  208.     cd /data/data/com.termux/files/home/storage/shared/Study-Materials
  209.     ls
  210.     echo -e "Enter folder name u want please wait creating directory"
  211.     read fname
  212.     mkdir $fname-$(echo "$(date +%d-%A-%m-%B-%Y-%X%P)" | sed 's, ,-,g')
  213.     cd $fname-*
  214.     pwd
  215.     ls
  216.     echo -e "Enter url contain direct pdf files in gdrive 0"
  217.     echo -e "Enter url contain direct pdf files 1"
  218.     echo -e "Enter url contain next level web page pdf file 2"
  219.     read opt
  220.     if [ "$opt" -eq "0" ]
  221.     then
  222.     lynx -listonly -nonumbers -dump $1
  223.     echo -e "Enter links to extract name and enter .txt file name like link name\n"
  224.     read link name
  225.     lynx -listonly -nonumbers -dump $1 | grep $link > $name.txt
  226.     echo -e "please wait .pdf files downloading gdrivedl.... \n"
  227.     while read file;do gdrivedl $file;done < $name.txt
  228.     elif [ "$opt" -eq "1" ]
  229.     then
  230.     lynx -listonly -nonumbers -dump $1
  231.     echo -e "Enter links to extract name and enter .txt file name like link name\n"
  232.     read link name
  233.     lynx -listonly -nonumbers -dump $1 | grep $link > $name.txt
  234.     echo -e "please wait .pdf file downloading.... \n"
  235.     while read file;do aria2c -c -x 16 -s 16 -k 1M $file;done < $name.txt
  236.     elif [ "$opt" -eq "2" ]
  237.     then
  238.     lynx -listonly -nonumbers -dump $1
  239.     echo -e "Enter links to extract name and enter .txt file name like link name\n"
  240.     read link name
  241.     lynx -listonly -nonumbers -dump $1 | grep $link > $name.txt
  242.     echo -e "please wait .pdf file downloading.... \n"
  243.     while read file;do aria2c -c -x 16 -s 16 -k 1M $(lynx -listonly -nonumbers -dump $file | grep .pdf );done < $name.txt
  244.     fi
  245. elif [ "$option" -eq "20" ]
  246. then
  247.     echo "$folder --yes-playlist -f 140" > ~/.config/youtube-dl/config
  248.     youtube-dl $1
  249. elif [ "$option" -eq "21" ]
  250. then
  251.     echo -e "paste here your single url THAu press 1"
  252.     echo -e "paste here your single url FinoU press 2"
  253.     read opt
  254.     if [ "$opt" -eq "1" ]
  255.     then
  256.     cd ~/storage/shared/IAS/TheHindu/;ls
  257.     echo -e "$pwd\n Downloading web content ...."
  258.     ls
  259.     echo -e "paste here your single url"
  260.     THAu
  261.     echo -e "your single url data downloaded"
  262.     rm New*
  263.     sleep 3
  264.     elif [ "$opt" -eq "2" ]
  265.     then
  266.     cd ~/storage/shared/StudyMaterials/Finalogy
  267.     echo -e "$pwd\n Downloading web content ...."
  268.     ls
  269.     echo -e "paste here your single url"
  270.     FinoU
  271.     rm NewFilename*
  272.     echo -e "your single url data downloaded"
  273.     sleep 3
  274.     fi
  275. elif [ "$option" -eq "22" ]
  276. then
  277.     youtube-dl $dfol -f 140 $1 > ~/.config/youtube-dl/config
  278. elif [ "$option" -eq "23" ]
  279. then
  280.     cd ~/storage/shared/IAS/TheHindu/;ls
  281.     echo -e "$pwd\n Downloading web content ...."
  282.     ls
  283.     echo -e "paste here your single url"
  284.     THAu
  285.     echo -e "your single url data downloaded"
  286.     rm New*
  287.     sleep 3
  288. fi
  289.  
  290.  
  291.  
  292.  
  293.  
  294. #/storage/emulated/0/Study-Materials/DristiIASm4a
  295.  
  296. #elif [ "$option" -eq "21" ]
  297. #then
  298. #    cd /data/data/com.termux/files/home/storage/shared/Study-Materials
  299. #    ls
  300. #    echo -e "Downloading web content ...."
  301. #    TheHinduArticle > $(touch $(echo "$(date +%A%d-%B-%Y-Time-%I-%M).txt"))
  302. #    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")
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement