Raised This Month: $51 Target: $400
 12% 

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


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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:
    3 
    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 - 4745 views - 4.4 KB)

    Last edited by namazso; 08-23-2019 at 15:34.
    namazso is offline
     



    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 13:49.


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