Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #################################################
- # #
- # Basic script to play stream videos and audios #
- # using mpv if present #
- # #
- # https://pastebin.com/raw/fSwhuPyx #
- #################################################
- # mpv: symbol lookup error: /usr/lib/libsmbconf.so.0: undefined symbol: nt_time_to_full_timespec, version SAMBA_UTIL_0.0.1
- # mpv 0.32.0 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
- # built on UNKNOWN
- # ffmpeg library versions:
- # libavutil 56.31.100
- # libavcodec 58.54.100
- # libavformat 58.29.100
- # libswscale 5.5.100
- # libavfilter 7.57.100
- # libswresample 3.5.100
- # ffmpeg version: 4.2.2-1ubuntu1
- ###############################################################
- # lets define basic variables to do the rest of the nasty job #
- ###############################################################
- APP="mpv"
- UA="User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0"
- # https://forum.puppylinux.com/viewtopic.php?f=160&t=1523&sid=c85ab12e383da8cf8606f3e4d4434e5c
- # https://forum.endeavouros.com/t/use-mpv-for-video-on-urls/10316
- ######################################################
- # lets check if we have the app(s) install in our OS #
- ######################################################
- list=( $APP )
- for i in "${list[@]}" ; do
- if ! command -v $i &> /dev/null ; then
- echo "$i isnt install yet"
- exit
- fi
- done
- # audio files
- # ogg , mp3 , flac , m3u
- URL="https://archive.org/download/1968-electric-ladyland/1968-electric-ladyland_vbr.m3u"
- URL="https://ia801207.us.archive.org/35/items/Akala-The_War_Mixtape_Vol.2_Deluxe_Edition-Bootleg-2CD-2008-RAGEMP3/101-akala-welcome_back_to_england.ogg"
- URL="https://ia801207.us.archive.org/35/items/Akala-The_War_Mixtape_Vol.2_Deluxe_Edition-Bootleg-2CD-2008-RAGEMP3/105-akala-heaterz_%28freestyle%29.mp3"
- URL="https://ia903403.us.archive.org/11/items/1968-electric-ladyland/02%20-%20Have%20You%20Ever%20Been%20%28To%20Electric%20Ladyland%29.flac"
- # ogv , mp4 , mkv
- URL="https://ia800408.us.archive.org/33/items/CastingCrowns-NightOfJoy2014/CastingCrowns-NightOfJoy2014.ogv"
- URL="https://archive.org/download/disorder_in_the_court/disorder_in_the_court.mp4"
- URL="https://archive.org/download/CastingCrowns-NightOfJoy2014/CastingCrowns-NightOfJoy2014.mkv"
- # youtube
- URL="https://www.youtube.com/watch?v=j6yppO90X3g"
- # Stream url
- URL="https://streaming-live.rtp.pt/liverepeater/smil:rtpn.smil/rtp_playlist.m3u8?token=1625198400_12685bd9e5e3adcc27128238375edce05ba07efa"
- ##################################################
- # lets set optins if youtube or strem or default #
- ##################################################
- if [[ $URL =~ "youtube" ]] ; then
- command="--hwdec-codecs=all"
- elif [[ $URL =~ "m3u8" ]] ; then
- command="--http-header-fields=\"${UA}\""
- else
- command=""
- fi
- ################################
- # lunch app with right options #
- ################################
- echo mpv ${command} "${URL}"
- mpv ${command} "${URL}"
Add Comment
Please, Sign In to add comment