get newest additions to a youtube playlist using youtube-dl - linux

I've got a collaborative youtube playlist with some friends that we use when we get together to play games. The problem is that the internet connection where we get together is quite bad. So I made a little script where people can send songs using bluetooth or by sending a youtube link (youtube-dl downloads the mp3 file of that video using a script that uses the currently selected (youtube) link). I wanted an easier method of adding videos to the offline playlist.
I want to use the collaborative playlist to determine which songs are to be downloaded but I only want the newest additions to the playlist (since the last check/download) is it possible to retrieve the latest youtube playlist items in linux bash?

Have a look at the video selection options. In particular, --download-archive can be used for this purpose.
Simply run youtube-dl --download-archive /path/to/the/archive/file playlist_url. This will download all new songs in the playlist. If your playlist is large, you can also use --playlist-end 42 to only consider the first 42 songs.

Related

Is it possible to show the title and link of a song that started from queue while using lavalink.py

I am making a disord.py music bot using lavalink.py for music streaming. Right now whenever you have a queue of songs it will play through them all, but in order to see what song is currently playing you need to use a command for it. I want the discord bot to send an embed with the song name and link when the next song in the queue starts. I used to use youtube-dl for the music function but it has since stopped working. I'm not sure if I need to use the StartTrackEvent and if I do, I'm not sure how to actually implement it to where it will send a message in the discord channel. Also, my music code is in a cog if that makes much of a difference.
(I'm new to SO, excuse me if my answer isn't super great)
You would not need an event to do this (assuming you're using the commands extension.) You could make your queue command, and use AudioTrack.title and AudioTrack.identifier to get the track and Youtube identifier. Using the identifier you could link to the track with https://youtube.com/watch?v=<identifier>. An example of this would be:
#commands.command(name="current",description="Shows the current playing song.",usage="current",aliases=['np','nowplaying'])
async def current(self,ctx):
player = self.bot.lavalink.player_manager.get(ctx.guild.id)
embed=discord.Embed(title=player.current.title,url=f"https://youtube.com/watch?v={player.current.identifier}")
await ctx.send(embed=embed)
This would return an embed that contains the title of the current track, and a link to the site in the title.

Add audio in dialog (Bixby)

This is my first question, new and fresh, hello guys.
As the title mentions, is there any workaround or way to add audio inside dialog-speech-template? As it doesn't support mp3, and only wav, I found it hard to implement.
The audio I wanted to get is origin from API, and hence it's not possible for me to download the mp3 file and convert it (as changes may happen to the audio).
Is there any programmatic way to convert the mp3 audio to wav? I am pretty new to Bixby, hope elders here can help.
Unfortunately, Bixby SSML only for certain wav format. Please refer SSML#AudioClip for details. There are also instructions how to convert using ffmpeg tool.
To support mp3 format, you can raise a Feature Request in our community. This forum is open to other Bixby developers who can upvote it, leading to more visibility within the community and with the Product Management team.

How to Create a Spotify Playlist from a File

I have a text file I created using fb2k text tools; Artist Name - Song Name \n(new line)
This file includes my full music library, including 85k songs.
I'd like to somehow convert this to a single or multiple Spotify Playlists.
playlist-converter.net is doing one song per second, which means it is going to take roughly 24 hours to create this playlist on that site.
Is there any way i can do this locally using some github script or maybe a site that allows you to upload a file which will convert fairly quickly?
Thanks in advance
I dont know if exists a ready-to-use script for this, but you can do it yourself, its not that hard if you know some programming language.
You can use Spotify API
https://developer.spotify.com/
For each line, you will have to call API with the name of song and Artist
https://developer.spotify.com/web-api/search-item/
So will return an JSON object, with the id of song.
For each id you will have to call api again, to include the new song
https://developer.spotify.com/web-api/add-tracks-to-playlist/
Thats it, good luck !

Parsing youtube from one category

I have a task to parse links and titles from YouTube videos from one category (e.g. music).
I know that there's a huge amount of videos so that's my question. How to do it using for example nodeJS?
I have only one idea simply to use phantomJS and scroll scroll scroll down page to get as many videos as I can, but this solution is dumb.
Are there any other solutions, using YouTube API for example or other tools and methods?
https://www.googleapis.com/youtube/v3/search?part=snippet&type=video&videoCategoryId=10&key=Your Key Here
try using this. First find out which category video id you need

Getting xml for a playlist - custom spotify playlist

I am looking to create a custom spotify playlist rather than use the generator via the website. I need a way of grabbing this xml, rather like the lookup and search facilities that the webAPI provide. I have tried to use a playlist spotifyURI with the lookup functionality but it doesnt seem to work.
e.g.
http://ws.spotify.com/lookup/1/?uri=spotify:user:XXX:playlist:YYY
However, using this just gives me the following error :
"You hit the rate limit, wait 10 seconds and try again"
I don't think I have really hit the hitrate, I only tried it a few times.
If this isnt the way to go, what other options are there ? libSpotify ? This seems like rather a bigger solution for just getting some xml for a playlist.
Any help appreciated.
The web API doesn't support playlist lookup at all. If you want to find playlist data, you'd have to use libspotify.

Resources