open.mp forum
[Library] [MV]_Youtube - Stream youtube video's and have playlists - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Releases (https://forum.open.mp/forumdisplay.php?fid=13)
---- Forum: Libraries (https://forum.open.mp/forumdisplay.php?fid=31)
---- Thread: [Library] [MV]_Youtube - Stream youtube video's and have playlists (/showthread.php?tid=481)



[MV]_Youtube - Stream youtube video's and have playlists - michael@belgium - 2019-04-28

The samp forum thread is litteraly unreadable.

[MV]_Youtube

An advanced Youtube streamer where you can have playlists and stream youtube video's. 1 video can be played with 1 line of code.

[Image: oRnMo.jpg]

[Image: oRnNh.png]

Functions

Code:
native PlayYoutubeVideoFor(url[], playfor = INVALID_PLAYER_ID, playlist = INVALID_PLAYLIST_ID, bool:usepos = false, Float:distance = 50.0)
-> returns a youtubeid
native StopYoutubeVideo(youtubeid)

native IsValidYoutubeURL(string[])
native IsYouTubeVideoPlaying(youtubeid)

native GetVideoDuration(youtubeid)
native GetVideoTitle(youtubeid)
native GetVideoLink(youtubeid)
native GetVideoStreamLink(youtubeid)
native GetVideoTarget(youtubeid)

native CreatePlaylist(name[])
-> returns a playlistid
native RemovePlaylist(playlistid)
native GetPlaylistName(playlistid)
native GetPlaylistSongs(playlistid)
native GetPlaylistSongsCount(playlistid)
native GetPlaylistFromVideo(youtubeid)

native SearchYoutubeVideos(playerid, searchquery[])
public OnYoutubeSearch(playerid)

public OnYoutubeVideoStart(youtubeid)
public OnYoutubeVideoFinished(youtubeid)
public OnMVYoutubeError(youtubeid, message[])
public OnPlaylistAddEntry(playlistid, youtubeid)
public OnPlaylistFinished(playlistid)

Installation

Code:
sampctl package install MichaelBelgium/MV_Youtube

or download it manually and

Code:
#include <MV_Youtube>

Configuration

Create your own Youtube-to-mp3 api and use the include with it
https://github.com/MichaelBelgium/Youtube-to-mp3-API


RE: [MV]_Youtube - Stream youtube video's and have playlists - RenanMsV - 2019-04-30

question is, will your website be able to handle all requests?
add this to this topic description, so people can host their own fetch url https://github.com/MichaelBelgium/Youtube-to-mp3-API


RE: [MV]_Youtube - Stream youtube video's and have playlists - michael@belgium - 2019-04-30

(2019-04-30, 03:45 AM)RenanMsV Wrote: question is, will your website be able to handle all requests?

add this to this topic description, so people can host their own fetch url https://github.com/MichaelBelgium/Youtube-to-mp3-API



It's fine, downloading and converting takes just a few seconds, but daily there's much traffic yeah. It's not only used from samp servers.

Always thought about making people to pay monthly for it or something lol, with api keys


RE: [MV]_Youtube - Stream youtube video's and have playlists - hual - 2019-05-01

Does this rely on youtube-dl?

also "[MV]_******* | Simple but yet useful ******* streamer" lmfao that's just sad


RE: [MV]_Youtube - Stream youtube video's and have playlists - michael@belgium - 2019-05-01

(2019-05-01, 02:11 PM)hual Wrote: Does this rely on youtube-dl?



also "[MV]_******* | Simple but yet useful ******* streamer" lmfao that's just sad



Yes it does. Yes it is. /shrug


RE: [MV]_Youtube - Stream youtube video's and have playlists - RenanMsV - 2019-05-03

(2019-04-30, 07:11 PM)michael@belgium Wrote: Always thought about making people to pay monthly for it or something lol, with api keys



Yeah you should implement API keys to handle it (but free, as you're using someone's code), so you can track all requests, throttle requests, delete inactive?users or just block the abusive?ones.


RE: [MV]_Youtube - Stream youtube video's and have playlists - michael@belgium - 2019-05-04

(2019-05-03, 03:14 PM)RenanMsV Wrote: .. as you're using someone's code ...



Who's? *thinking* If you mean youtube-dl then i guess. The include and api is made by me (but like i said, using youtube-dl)


RE: [MV]_Youtube - Stream youtube video's and have playlists - nikisb - 2019-07-21

your api key for google is dead xd