Advertisement
To-Slalom

Video_dl_2

Sep 29th, 2021
1,597
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 10.74 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Start by setting up your file. Make it anywhere that you like.
  4. # $ touch ffmpeg-batch.sh
  5. # Then, make it executable.
  6. # $ chmod +x ffmpeg-batch.sh
  7. # https://linuxconfig.org/how-to-use-ffmpeg-to-convert-multiple-media-files-at-once-on-linux
  8.  
  9. header=" -headers $'Cookie: logged_in=yes; tracker=direct\r\n'"
  10. q=$(printf 'Googlebot/2.1 (+http://www.google.com/bot.html)\r\nx')
  11. # ffmpeg -headers "${q%x}"
  12.  
  13. # Defenir link m3u8
  14. m3u8="https://streaming-vod2.iol.pt/vod/_definst_/f/5/a/8/smil:5f7fa46a0cf2ae07a253f5a8-L/playlist.m3u8"
  15. m3u8="https://streaming-ondemand.rtp.pt/nas2.share/h264/512x384/p5300/index.m3u8?tlm=hls&streams=p5300_2_201911191505247723.mp4.m3u8:1024"
  16. m3u8="https://manifest.prod.boltdns.net/manifest/v1/hls/v4/clear/5853423584001/0594ee0f-271e-4958-a9f9-391e7f5c0743/10s/master.m3u8?fastly_token=NWY4MDIyNThfYzJlY2NlZDk5ODliNTIzYjJlMzU2NmZlOWZhMWQxZmRhYmI3YmNlMzYxMzU0ZTQ2MzI1MmFkZTlkODZiMDYyZQ%3D%3D"
  17. m3u8="https://videos.elperiodico.com/elperiodico/mp4/1/2/1602071081921.m3u8"
  18. m3u8="https://streaming-ondemand.rtp.pt/nas2.share/h264/512x384/p5300/index.m3u8?tlm=hls&streams=p5300_1_201911121610032898d.mp4.m3u8:1024"
  19. m3u8="https://prod-ec-eu-west-1.video.pscp.tv/Transcoding/v1/hls/NW9xhQ_rJEdp376n-ORt8N1f8PrijZyXwKwcrrzaz2ud6P_kPaE73ori-1yaKJhv57QEXbQm3FkcHaHx8jHNTg/non_transcode/eu-west-1/periscope-replay-direct-prod-eu-west-1-public/master_dynamic_16844064223069006613.m3u8?type=replay"
  20. # Defenir User Agent
  21. ua="Mozilla/5.0 (Windows NT 10.0; WOW64; rv:77.0) Gecko/20100101 Firefox/77.0"
  22. ua="Mozilla/5.0 (compatible; Companybot/1.0; +http://www.Thecompany.com)"
  23.  
  24. # meta data do video
  25. #metadata= -metadata title="$Title"
  26.  
  27. #ffmpeg -user-agent "${ua}" -i "${m3u8}" -seekable 0 -c copy -bsf:a aac_adtstoasc aa.mp4
  28.  
  29. # a="hello world"
  30. # echo "${a// /_}" # trocar espaço por _
  31. #ffplay "https://video.sicnoticias.pt/sicnot/2020-10-15/b4dc718e-4c85-46ca-944f-07798fc627ee_lourenc3a7o-medeiros/playlist.m3u8"
  32. #read -p "Press enter to continue"
  33.  
  34.  
  35. # lista de videos a sacar
  36. # vid_list=(
  37. #     https://videos.elperiodico.com/elperiodico/mp4/1/2/1602071081921.m3u8
  38. #     https://videos.elperiodico.com/elperiodico/mp4/1/2/1602071081921.m3u8
  39. #     https://videos.elperiodico.com/elperiodico/mp4/1/2/1602071081921.m3u8
  40. #     https://videos.elperiodico.com/elperiodico/mp4/1/2/1602071081921.m3u8
  41. #     https://videos.elperiodico.com/elperiodico/mp4/1/2/1602071081921.m3u8
  42. #     )
  43. # https://www.rtp.pt/play/p6714/e450717/sociedade-civil
  44. # https://www.rtp.pt/play/p5300/e438338/sociedade-civil
  45.  
  46. # vid_list=(
  47. #     #https://streaming-ondemand.rtp.pt/nas2.share/h264/512x384/p6714/index.m3u8?tlm=hls&streams=p6714_1_202001171610045734d.mp4.m3u8:1024
  48. #     # https://streaming-ondemand.rtp.pt/nas2.share/h264/512x384/p5300/index.m3u8?tlm=hls&streams=p5300_1_201911121610032898d.mp4.m3u8:1024
  49. #     # https://prod-ec-eu-west-1.video.pscp.tv/Transcoding/v1/hls/NW9xhQ_rJEdp376n-ORt8N1f8PrijZyXwKwcrrzaz2ud6P_kPaE73ori-1yaKJhv57QEXbQm3FkcHaHx8jHNTg/non_transcode/eu-west-1/periscope-replay-direct-prod-eu-west-1-public/master_dynamic_16844064223069006613.m3u8?type=replay
  50. #     # https://streaming-live.rtp.pt/liverepeater/smil:rtpn.smil/rtp_playlist.m3u8
  51. #     https://video.sicnoticias.pt/sicnot/2020-10-15/cd01192f-f682-4ec1-93fd-051612ba0607_th-reis-novais-mc3a1scara-e-app_20hv00606641/playlist.m3u8
  52. # )
  53.  
  54. # vid_list=(
  55. #     https://video.sicnoticias.pt/sicnot/2020-10-15/b4dc718e-4c85-46ca-944f-07798fc627ee_lourenc3a7o-medeiros/playlist.m3u8
  56. #     https://video.sicnoticias.pt/sicnot/2020-10-15/29ae5788-c589-472b-8741-59db42d5d637_mc3a1scaras-na-rua/playlist.m3u8
  57. #     https://video.sicnoticias.pt/sicnot/2020-10-15/821cc87a-e109-441d-9ba8-f9704e488aa9_reac3a7c3b5es-app-covid/playlist.m3u8
  58. #     https://video.sicnoticias.pt/sicnot/2020-10-14/00f61ea6-e457-4846-9d3f-b3670d30fae1_entrevista-jn/playlist.m3u8
  59. #     https://video.sicnoticias.pt/sicnot/2020-10-16/5fd0cfa5-cb5c-4d94-ad5c-281ba1d32397_marcelo-mc3a1scaras-jn_20hv00610437/playlist.m3u8
  60. #     https://video.sicnoticias.pt/sicnot/2020-10-16/619c8a06-fde3-4bd7-8a14-c56ac630dd08_costa-app-covid-jn/playlist.m3u8
  61. #     https://streaming-vod3.iol.pt/vod/_definst_/3/9/e/9/smil:5f8815790cf2649b904839e9-L/playlist.m3u8
  62. #     https://streaming-vod2.iol.pt/vod/_definst_/d/e/3/d/smil:5f8812a10cf21176e3efde3d-L/playlist.m3u8
  63. # )
  64.  
  65. vid_list=(
  66.     # https://streaming-vod1.iol.pt/vod/_definst_/2/1/1/c/smil:5f8e18b60cf2c785554a211c-L/playlist.m3u8
  67.     # https://video.sicnoticias.pt/sicnot/2020-10-24/bfa26729-6b8d-45a1-affc-3a5608ef4caf_rap/playlist.m3u8
  68.     # https://video.sicnoticias.pt/sicnot/2020-10-26/38c2ea78-2003-4464-87cb-b5e8224818df_expresso-da-meia-noite-pgm-23102020/playlist.m3u8
  69.     # https://video.sicnoticias.pt/sicnot/2020-10-20/ed625c85-71aa-4939-b156-214c857f4d9f_judice/playlist.m3u8
  70.     #https://video.sicnoticias.pt/sicnot/2020-10-26/6acdc2ed-7578-4058-96e9-7fd4764ba9d4_pedro-simas_20hv00638519/playlist.m3u8
  71.     # https://video.sicnoticias.pt/sicnot/2020-10-27/2647371d-1e01-47a6-92a1-2cbf7d0ee255_as-causas_20hv00641191/playlist.m3u8
  72.     # https://video.sicnoticias.pt/sicnot/2020-10-26/ad221db1-ad90-43d0-8b49-d8dc3729b6f2_constantino-sakellarides/playlist.m3u8
  73.     # https://streaming-vod2.iol.pt/vod/_definst_/2/6/c/4/smil:5f9ab5580cf28e704d9326c4-L/playlist.m3u8
  74.     # https://streaming-vod3.iol.pt/vod/_definst_/9/8/7/0/smil:14249870-L/playlist.m3u8
  75.     # 'https://streaming-ondemand.rtp.pt/nas2.share/h264/512x384/p6559/index.m3u8?tlm=hls&streams=p6559_1_202011022035182816.mp4.m3u8:1024'
  76.     # 'https://streaming-ondemand.rtp.pt/nas2.share/h264/512x384/p7947/index.m3u8?tlm=hls&streams=p7947_202011022219333858.mp4.m3u8:1024'
  77.     # https://streaming-vod3.iol.pt/vod/_definst_/9/d/2/c/smil:5fa08fe70cf203abc5ae9d2c-L/playlist.m3u8
  78.     # 'https://streaming-ondemand.rtp.pt/nas2.share/h264/512x384/p7967/index.m3u8?tlm=hls&streams=p7967_2_202011064823.mp4.m3u8:1024'
  79.     # https://streaming-vod3.iol.pt/vod/_definst_/1/b/6/8/smil:5f9dbea80cf203abc5ae1b68-L/playlist.m3u8
  80.     # 'https://prod-ec-eu-west-1.video.pscp.tv/Transcoding/v1/hls/DD7Ik4dkrtiHxz6FkkcF9n1EpacRo_gP2RxJWt6Y8xr3zeWGHYb6iO_iruFrQDDQTRSUcLsvTBJ0sV2z0gRxHw/non_transcode/eu-west-1/periscope-replay-direct-prod-eu-west-1-public/master_dynamic_16841947712059731207.m3u8?type=replay'
  81.  
  82.     # https://streaming-vod1.iol.pt/vod/_definst_/1/7/b/3/smil:5fa9cbac0cf2ec6e471217b3-L/playlist.m3u8
  83.     # https://streaming-vod3.iol.pt/vod/_definst_/c/3/1/e/smil:5fad9d950cf203abc5b0c31e-L/playlist.m3u8
  84.     #https://streaming-vod2.iol.pt/vod/_definst_/5/e/d/7/smil:5fadba460cf28e704d965ed7-L/playlist.m3u8
  85.     # https://streaming-vod2.iol.pt/vod/_definst_/d/f/2/1/smil:5fb2fd870cf2c7855550df21-L/playlist.m3u8
  86.     # https://streaming-vod3.iol.pt/vod/_definst_/4/e/8/1/smil:5fbabda40cf28e704d984e81-L/playlist.m3u8
  87.     # https://streaming-vod3.iol.pt/vod/_definst_/9/1/9/a/smil:5eb41a770cf2a5883420919a-L/playlist.m3u8
  88.     # https://streaming-vod3.iol.pt/vod/_definst_/1/d/5/f/smil:5fbabdc30cf2c78555521d5f-L/playlist.m3u8
  89.     # https://streaming-vod3.iol.pt/vod/_definst_/c/5/7/2/smil:5fbae8f40cf203abc5b2c572-L/playlist.m3u8
  90.     # https://video.sicnoticias.pt/sicnot/2020-11-24/0a0585ed-38b9-4826-9e15-95501f997266_as-causas/playlist.m3u8
  91.     # https://streaming-ondemand.rtp.pt/nas2.share/h264/512x384/p6714/p6714_1_202011171610030346d/master.m3u8
  92.     # https://streaming-vod2.iol.pt/vod/_definst_/0/2/b/6/smil:5fabdd8c0cf28e704d9602b6-L/playlist.m3u8
  93.     # https://streaming-vod1.iol.pt/vod/_definst_/c/3/7/5/smil:5fc4f8090cf2c7855553c375-L/playlist.m3u8
  94.     # https://streaming-ondemand.rtp.pt/nas2.share/h264/512x384/p7908/p7908_1_202012221311598365/master.m3u8
  95.     # https://video.sicnoticias.pt/sicnot/2020-12-23/0591e304-766d-4755-a6c2-acc1e3be9235_antc3b3nio-pais-martins/playlist.m3u8
  96.     # https://streaming-vod1.iol.pt/vod/_definst_/9/a/a/8/smil:5feb8c5a0cf2ec6e471b9aa8-L/playlist.m3u8
  97.     # https://streaming-vod2.iol.pt/vod/_definst_/5/9/c/d/smil:6008bd150cf27e103fcc59cd-L/playlist.m3u8
  98.     # https://streaming-ondemand.rtp.pt/nas2.share/h264/512x384/p8155/p8155_1_202101231359180721/master.m3u8
  99.     # https://streaming-vod3.iol.pt/vod/_definst_/2/8/1/5/smil:600edb290cf245b9a9762815-L/playlist.m3u8
  100.     # https://streaming-vod1.iol.pt/vod/_definst_/6/d/7/1/smil:5fccd88d0cf203abc5b56d71-L/playlist.m3u8
  101.     # https://streaming-vod2.iol.pt/vod/_definst_/3/2/e/9/smil:60082ef70cf27e103fcc32e9-L/playlist.m3u8
  102.     # https://streaming-vod2.iol.pt/vod/_definst_/1/6/f/b/smil:6011f74b0cf27e103fce16fb-L/playlist.m3u8
  103.     # https://streaming-vod1.iol.pt/vod/_definst_/5/6/6/e/smil:60132be60cf27e103fce566e-L/playlist.m3u8
  104.     # https://streaming-vod1.iol.pt/vod/_definst_/8/8/2/e/smil:6014133b0cf289c41a90882e-L/playlist.m3u8
  105.     # https://video.expresso.pt/sicnot/2021-02-01/927c518f-3b46-4ae1-a724-e14ad4b7e4a7_grac3a7a-freitas/playlist.m3u8
  106.     # https://streaming-vod1.iol.pt/vod/_definst_/3/5/8/b/smil:60203f020cf2951d9a0a358b-L/playlist.m3u8
  107.     # https://streaming-vod2.iol.pt/vod/_definst_/f/4/1/9/smil:601952fc0cf2951d9a08f419-L/playlist.m3u8
  108.     # https://streaming-vod3.iol.pt/vod/_definst_/8/1/d/3/smil:602325740cf289c41a9381d3-L/playlist.m3u8
  109.     # https://streaming-vod1.iol.pt/vod/_definst_/4/d/b/c/smil:602303910cf27e103fd14dbc-L/playlist.m3u8
  110.     # https://manifest.prod.boltdns.net/manifest/v1/hls/v4/clear/6108484330001/844e79f3-d3aa-40d4-9609-06390885d514/2cffa86b-0870-4456-b5a3-37fa860905b7/10s/rendition.m3u8?fastly_token=NjA2NjExMTdfMjE4M2NkZTU4NGY3NDg0N2FjYWU3NGQ3OTY3NWIzYjQ0MjY0MTlhYTgyMGYxMjJjMGM3NWNhNmVmMjc3MDRkZQ%3D%3D
  111.     # https://manifest.prod.boltdns.net/manifest/v1/hls/v4/clear/6108484330001/844e79f3-d3aa-40d4-9609-06390885d514/f05f35f8-aa01-47d0-9988-342fc16bca97/10s/rendition.m3u8?fastly_token=NjA2NjExMTdfMGIxOGU1OGMwYzgzODAxOTJhZDhkNWIwNTRmNjAzNzUxZTY4MzU4MjA1ZDlhZDY1M2M4YzY3YmVkZWNlYjNkZQ%3D%3D
  112.     # https://streaming-vod3.iol.pt/vod/_definst_/f/1/8/e/smil:605dc08d0cf280db40fff18e-L/playlist.m3u8
  113.     # https://manifest.prod.boltdns.net/manifest/v1/hls/v4/clear/6058004172001/f5e28c76-0c65-4ba4-af76-ff253726ccf4/e510b235-1cf3-4f23-85e2-5020cb534576/6s/rendition.m3u8?fastly_token=NjBjMzA1ZTJfYmNkNWQwYzZiZjI3NDUwN2MxZjM0MGYwZTg2MjIwYmQ0OGU5MzBmYjVhMzY3NDYzY2ViNmU0M2RhMjE3M2QxMw%3D%3D
  114.     # https://streaming-ondemand.rtp.pt/nas2.share/h264/512x384/p8241/p8241_1_20210602000000e021t4102/master.mpd
  115.     https://streaming-ondemand.rtp.pt/nas2.share/h264/512x384/p1525/p1525_1_202107076453/master.mpd
  116.    
  117.  
  118.  
  119. )
  120.  
  121. for key in "${!vid_list[@]}" ; do
  122.     echo "key: $key, value: ${vid_list[$key]}"
  123.     # ffmpeg command line
  124.     # ffmpeg -user-agent "${ua}" -i "${vid_list[$key]}" -seekable 0 -c copy -bsf:a aac_adtstoasc video_$key.mp4
  125.     # ffmpeg -user-agent "${ua}" -i "${vid_list[$key]}" -seekable 0 -c copy -bsf:a aac_adtstoasc Covid_$key.mp4
  126.     ffmpeg -user-agent "${ua}" -i "${vid_list[$key]}" -seekable 0 -c copy -bsf:a aac_adtstoasc 360_medico.mp4
  127.    
  128. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement