[Solved] Youtube Playlists with MPD?

If it doesn't relate to Debian, but you still want to share it, please do it here

[Solved] Youtube Playlists with MPD?

Postby bester69 » 2018-11-19 23:46

Hi,

I would like to listen youtube sounds playlists (study, relaxing, etc) with MPD..is it possible?

I can do it with smplayer or VLC; for vlc :
vlc --no-video --one-instance YoutubePlaylist.txt


Thanks.
Last edited by bester69 on 2019-03-15 01:52, edited 2 times in total.
bester69 wrote:You wont change my mind when I know Im right, Im not an ...
User avatar
bester69
 
Posts: 1413
Joined: 2015-04-02 13:15

Re: Youtube Playlists with MPD?

Postby oswaldkelso » 2018-11-20 07:25

Yes.
Ash init durbatulûk, ash init gimbatul,
Ash init thrakatulûk agh burzum-ishi krimpatul.
User avatar
oswaldkelso
 
Posts: 1176
Joined: 2005-07-26 23:20
Location: UK

Re: Youtube Playlists with MPD?

Postby bester69 » 2018-11-20 08:49

I would like to be able to play in cantata youtube's playlists.. :cry:

Image
bester69 wrote:You wont change my mind when I know Im right, Im not an ...
User avatar
bester69
 
Posts: 1413
Joined: 2015-04-02 13:15

Re: Youtube Playlists with MPD?

Postby bester69 » 2019-03-15 01:44

Ive got a Solution >>We will use following scripts.:

1- We get Playlist from youtube (viewtopic.php?f=16&t=137756)
Getting the playlist .txt from youtube; so we can download the whole playlist shortcuts.:
Code: Select all
$ git clone https://github.com/alexfalcucc/playlist-easy


youget.sh
Code: Select all
###Usar Comillas dobles al pasarle la Playlist
python2 /home/myuser/.local/share/youtube_playlist/youParse.py $1 > Playlist_youtube.txt
echo "Las URL's son.:"
cat ./Playlist_youtube.txt


2- Script to add youtube-URL converted in mpd playlist
youmpd.sh
Code: Select all
#!/bin/bash
#
MPDLIST=/home/user/.mpd/playlists
mpduri="$(youtube-dl -f best -g $1)#"
TAG=$(youtube-dl -i --get-filename $1)
cadena="{\"title\":  \"$TAG\" }"
echo "$cadena"
mpduri=$mpduri$cadena
echo $mpduri >> $MPDLIST/Youtubes.m3u

echo $mpduri


3- Script to process all URL's in youtube txt playlist
youmpda.sh ./Playlist_youtube.txt
Code: Select all
#!/bin/bash
#
for i in `cat $1`;
do
clear
echo $i
youmpd $i;

done

--------------------------------------
Example.:
youget.sh "https://www.youtube.com/watch?v=H36v9eSbF3o&list=PLoeiNRKM2TXKtjhTlYUd3kzzwqnx9yO_I"
youmpda ./Playlist-H36v9eSbF3o.txt

AND HERE YOU HAVE!!! :D

Image

Image
bester69 wrote:You wont change my mind when I know Im right, Im not an ...
User avatar
bester69
 
Posts: 1413
Joined: 2015-04-02 13:15

Re: [Solved] Youtube Playlists with MPD?

Postby bester69 » 2019-03-16 16:57

youtube doesnt seem to keep uri static for so long, so It only works for a few days :(

Anyways, Here another easy script for playing directly in MPD..

youmpdplay https://www.youtube.com/watch?v=zqXuBOWU1-8

youmpdplay.sh
Code: Select all
#!/bin/bash
#
MYHOST='192.168.1.128' # or your MPD host

mpduri="$(youtube-dl -f best -g $1)#"
TAG=$(youtube-dl -i --get-filename $1)
cadena="{\"title\":\"$TAG\"}"
echo "$cadena"
mpduri="$mpduri$cadena"
echo "$mpduri"
mpc insert "$mpduri"
mpc next
mpc play
bester69 wrote:You wont change my mind when I know Im right, Im not an ...
User avatar
bester69
 
Posts: 1413
Joined: 2015-04-02 13:15

Re: [Solved] Youtube Playlists with MPD?

Postby bester69 » 2019-03-17 16:43

Perhaps, A better alternative,
https://github.com/mps-youtube/mps-youtube
mps-youtube is able to toad and save playlist to disk, and great program to listen music in youtube.

Features

Search and play audio/video from YouTube
Search tracks of albums by album title
Search and import YouTube playlists
Create and save local playlists
Download audio/video
Convert to mp3 & other formats (requires ffmpeg or avconv)
View video comments
Requires mplayer or mpv
bester69 wrote:You wont change my mind when I know Im right, Im not an ...
User avatar
bester69
 
Posts: 1413
Joined: 2015-04-02 13:15

Re: [Solved] Youtube Playlists with MPD?

Postby Bloom » 2019-03-17 16:57

mps-youtube is in de Debian repositories for Jessie, Stretch and Sid.
User avatar
Bloom
 
Posts: 137
Joined: 2017-11-11 12:23

Re: [Solved] Youtube Playlists with MPD?

Postby stevepusser » 2019-03-17 19:55

Bloom wrote:mps-youtube is in de Debian repositories for Jessie, Stretch and Sid.


Per request, here's the latest 0.2.8 release (not in Debian) for testing: https://build.opensuse.org/package/show ... ps-youtube
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Foliate 1.5.3, Minitube 3.1, wine-staging 4.12, Virtual Box 5.2.32 & 6.0.10, Pale Moon 28.6.1, Waterfox 56.2.12
User avatar
stevepusser
 
Posts: 11007
Joined: 2009-10-06 05:53

Re: [Solved] Youtube Playlists with MPD?

Postby bester69 » 2019-03-17 21:20

stevepusser wrote:
Bloom wrote:mps-youtube is in de Debian repositories for Jessie, Stretch and Sid.


Per request, here's the latest 0.2.8 release (not in Debian) for testing: https://build.opensuse.org/package/show ... ps-youtube


hehe,You made for me, Thanks a lot Setve, :wink: , I removed request cos I saw it was able to execute it directlly from source package or using pip3 or python to install it.. so I didnt want to bother you if not neccesary..

dont know why, but 0.2.8 doesnt work well in my system.. most of songs are jumped in playlist..just a few ones are able to play.. the problem happend with any source installation.. with 0.2,7 there's no problem at all... I might be lacking some component in this newer version..dont know!
bester69 wrote:You wont change my mind when I know Im right, Im not an ...
User avatar
bester69
 
Posts: 1413
Joined: 2015-04-02 13:15

Re: [Solved] Youtube Playlists with MPD?

Postby bester69 » 2019-03-17 21:46

I used mpsyt --debug and search it on internet, and seems to be some kind of youtube-dl bug with quotes.

cat /tmp/mpsyt.log
Code: Select all
mpv --no-ytdl https://r5---sn-h5q7dnel.googlevideo.com/videoplayback?ip=78.30.35.91&key=yt6&dur=3719.601&lmt=1544464348967684&id=o-AGwfK7X7ILERD-0W1mUmX11HyIh-ykMWA3YCXBhTolIy&itag=251&requiressl=yes&keepalive=yes&mn=sn-h5q7dnel%2Csn-hgn7rn7k&mm=31%2C26&ms=au%2Conr&ei=c8OOXKjJJIXsxwLli72gBQ&mv=m&mt=1552859881&expire=1552881619&gir=yes&initcwndbps=607500&pl=19&source=youtube&signature=6F308EC977DB1CC1BE188D1CD8C183196789F3C4.21F0651F49A35B642E2323B63FC6B19D01149A5E&c=WEB&txp=5511222&mime=audio%2Fwebm&fvip=2&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&clen=67157505&ipbits=0&ratebypass=yes

Using quates, mpv can open the stream url.. so I guess its neccesary to use an older and specific youtube-dl version to work with 0.2.8 version. Dont know what is the properly way to fix this problem.
bester69 wrote:You wont change my mind when I know Im right, Im not an ...
User avatar
bester69
 
Posts: 1413
Joined: 2015-04-02 13:15

Re: [Solved] Youtube Playlists with MPD?

Postby stevepusser » 2019-03-18 18:06

What version of youtube-dl do you have installed?
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Foliate 1.5.3, Minitube 3.1, wine-staging 4.12, Virtual Box 5.2.32 & 6.0.10, Pale Moon 28.6.1, Waterfox 56.2.12
User avatar
stevepusser
 
Posts: 11007
Joined: 2009-10-06 05:53

Re: [Solved] Youtube Playlists with MPD?

Postby bester69 » 2019-03-19 12:40

stevepusser wrote:What version of youtube-dl do you have installed?

I tried last one and now have installed 2019.03.01.

I think It has to be with this report.:
https://github.com/mps-youtube/mps-youtube/issues/885

But I cant make it work..
bester69 wrote:You wont change my mind when I know Im right, Im not an ...
User avatar
bester69
 
Posts: 1413
Joined: 2015-04-02 13:15


Return to Offtopic

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable