• 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Library] [MV]_Youtube - Stream youtube video's and have playlists
#1
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
[Image: GitHub-michaelbelgium-000000.svg?style=for-the-badge]

  Reply
#2
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
  Reply
#3
(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
[Image: GitHub-michaelbelgium-000000.svg?style=for-the-badge]

  Reply
#4
Does this rely on youtube-dl?

also "[MV]_******* | Simple but yet useful ******* streamer" lmfao that's just sad
  Reply
#5
(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
[Image: GitHub-michaelbelgium-000000.svg?style=for-the-badge]

  Reply
#6
(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.
  Reply
#7
(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)
[Image: GitHub-michaelbelgium-000000.svg?style=for-the-badge]

  Reply
#8
your api key for google is dead xd
  Reply


Forum Jump: