Raised This Month: $52 Target: $400
 13% 

[ANY] Simple YouTube Music Player (1.2.3, 5/21/15)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
namazso
Member
Join Date: Mar 2012
Plugin ID:
4594
Plugin Version:
1.2.3
Plugin Category:
Fun Stuff
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    17 
    Plugin Description:
    A simple hidden MOTD youtube player.
    Old 04-11-2015 , 06:44   [ANY] Simple YouTube Music Player (1.2.3, 5/21/15)
    Reply With Quote #1

    Description

    Type !music <music name> to play YouTube videos in hidden MOTD windows.

    Limitations and Bugs
    1. YouTube Advertisements may play
    2. Playing with the same query may return different results with players in different countries, due to Google's search mechanism
    3. You cannot use !musicfull in CS:S and CS:GO (Likely not fixable without opening another video)

    For CS:GO users!

    Make a html file with the content below, upload it somewhere, and set the ytmusic_displayurl to the url of it.
    Code:
    <html>
      <body onload="window.open('https://www.youtube.com/watch?v=q6EoRBvdVPQ','Set your volume here','height=560,width=315');">
      </body>
    </html>
    CVars

    ytmusic_version "1.2.3" - Guess what..
    ytmusic_displayurl "" - Change only if !musicfull is not working on your mod. Url to some video to open for !musicfull.

    Commands

    !<yt|music> <music name> - Play first YouTube result of <music name>
    !<yt_|music>to <target> <music name> - Play first YouTube result of <music name> to <target>
    !<yt_|music>full - Display currently playing music (for changing volume)
    !<yt_|music>stop - Stop playing it.

    How does it work?

    It uses the special URL
    http://www.google.com/search?tbm=vid&btnI=1&q=<search terms urlencoded>
    (the above link will search for "yee")
    which means a google feeling lucky (= redirect to first result) search in videos

    Changelog

    v1.2.3
    • Added cvar ytmusic_displayurl. Change if !musicfull is not working in your mod.
    v1.2.2
    • Fixed stopping music
    • you can write !yt_* too instead of !music* (if you use SMDJ then use !dj for that)
    v1.2.1
    • Dammit, wrong file

    v1.2
    • Switched to transitional syntax (-> 1.7 compiler needed. compiled will probably run on older nevermind, it won't)
    • Added !musicto command
    • !musicyt (-> for compatiblity with smdj)
    • Correct url buffer size, as source engine limits it to 192 bytes (-> a limit of max 33 russian characters)
    • !musicfull command no longer needs music name, brings up currently opened one

    v1.1
    • URL-encoding for special chars (Untested)
    • Replaced left-in hungarian message saying "You f**ked it up, type !music <music name>"
    • Notify users about !musicfull and !musicstop after playing a song
    • !musicfull command

    v1.0
    • Initial release

    Credits:
    • URL encoding snippet with some modifications taken from here

    Download count of prior versions: 290
    Attached Files
    File Type: sp Get Plugin or Get Source (music.sp - 4102 views - 4.4 KB)

    Last edited by namazso; 08-23-2019 at 15:34.
    namazso is offline
    Delusional.
    Junior Member
    Join Date: Mar 2015
    Old 04-11-2015 , 08:14   Re: [ANY] Simple YouTube Music Player (1.0, 04/11/15)
    Reply With Quote #2

    I will test this, and return with some feedback.
    Delusional. is offline
    Aswanson
    New Member
    Join Date: Apr 2015
    Location: U.S.
    Old 04-16-2015 , 11:12   Re: [ANY] Simple YouTube Music Player (1.0, 04/11/15)
    Reply With Quote #3

    Plugin works great! There's just a couple of things I'd like to point out:
    1. Players must have HTML motd's enabled. Otherwise, the plugin won't work (it runs as a hidden html motd)
    2. YouTube advertisements can still be heard before a video starts. This could be confusing for players who search for a song and hear something totally different.

    Nice plugin! If you use this in your server, I'd make a note somewhere talking about the ads that may run before the music starts.
    Aswanson is offline
    Send a message via Skype™ to Aswanson
    NrX
    Member
    Join Date: Mar 2015
    Old 04-21-2015 , 01:21   Re: [ANY] Simple YouTube Music Player (1.0, 04/11/15)
    Reply With Quote #4

    i would like to know if i type !music <sound> everyone will hear os just me ? and if no there's some way to do like only people with flag "b" for example play the sound for everyone ??
    NrX is offline
    midnight9
    Senior Member
    Join Date: Nov 2012
    Old 04-21-2015 , 16:01   Re: [ANY] Simple YouTube Music Player (1.0, 04/11/15)
    Reply With Quote #5

    I would also be interested in seing this plugin having an additional command allowing an admin to play music for all players, something like !musical <music name>. But author is inactive so another plugin with good potential abandoned
    midnight9 is offline
    kanalumaddela
    Junior Member
    Join Date: Nov 2014
    Location: U.S.
    Old 04-21-2015 , 22:58   Re: [ANY] Simple YouTube Music Player (1.0, 04/11/15)
    Reply With Quote #6

    good work. it does the job. obviously cant really add "adblock" for youtube, similar to above my request is to change the command from "music" to something else as it can conflict with smdj, such as "yt <music name>" and admins can add @all to the end of the command
    kanalumaddela is offline
    namazso
    Member
    Join Date: Mar 2012
    Old 04-22-2015 , 16:55   Re: [ANY] Simple YouTube Music Player (1.0, 04/11/15)
    Reply With Quote #7

    Quote:
    Originally Posted by kanalumaddela View Post
    good work. it does the job. obviously cant really add "adblock" for youtube, similar to above my request is to change the command from "music" to something else as it can conflict with smdj, such as "yt <music name>" and admins can add @all to the end of the command
    I actually have been trying to add some sort of adblock, a modified php youtube downloader, but i cannot grab the audio stream only yet, althrough it is possible.. i will look into targeting others sometime

    Last edited by namazso; 08-23-2019 at 15:34.
    namazso is offline
    midnight9
    Senior Member
    Join Date: Nov 2012
    Old 04-22-2015 , 17:28   Re: [ANY] Simple YouTube Music Player (1.0, 04/11/15)
    Reply With Quote #8

    Quote:
    Originally Posted by namazso View Post
    I actually have been trying to add some sort of adblock, a modified php youtube downloader, but i cannot grab the audio stream only yet, althrough it is possible.. i will look into targeting others somewhen
    Hey, thanks for looking into this nice to see you are trying sort out the adds, but i would be more interested in allowing an admin to play music for all or a team.

    Regards
    midnight9 is offline
    Apina
    AlliedModders Donor
    Join Date: May 2013
    Old 05-01-2015 , 04:06   Re: [ANY] Simple YouTube Music Player (1.0, 04/11/15)
    Reply With Quote #9

    Cant listen a russian language music from youtube, i am writing and nothing happens. Can you fix it to support russian language
    Apina is offline
    doze
    Senior Member
    Join Date: Mar 2012
    Old 05-01-2015 , 11:32   Re: [ANY] Simple YouTube Music Player (1.0, 04/11/15)
    Reply With Quote #10

    Excellent plugin.

    I have noticed 1 bug with it, in hl2dm, you can't minimize the game using alt-tab or windows key anymore after a song is played, would be greatly appreciated if you fix this.

    A few other suggestions i have are;

    1) it would be nice if when a player is listening to a song the message " Player is listening to 'exact name of youtube video' " is displayed.

    2) after a player started listening to a song, it would be nice if he is informed he can stop it by !musicstop command.

    3) it would be nice if we had a way to control the volume.

    Last edited by doze; 05-01-2015 at 15:15.
    doze is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 23:15.


    Powered by vBulletin®
    Copyright ©2000 - 2021, vBulletin Solutions, Inc.
    Theme made by Freecode