Greasy Fork is available in English.

Discussions » Creation Requests

Help please to embed zippyshare player from link

§
Posted: 06 Februari 2015

Help please to embed zippyshare player from link

I'm searching for 3 days did not found something, say i have a simple mp3 zippyshare link http://www22.zippyshare.com/v/Gu68GbCi/file.html , i want instead of link to be the player, Please for rge love of javascript help me.
this is regex for the links
/^http:\/\/www([0-9][0-9])\.zippyshare.com\/v\/([a-zA-Z0-9]+)\/[a-zA-Z0-9]{4}\.[a-zA-Z0-9]+/g

woxxomMod
§
Posted: 06 Februari 2015

It's not clear where you want to embed this player. Anyway the embed code is visible in the page source:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="955" height="80" style="visibility: visible;"type="application/x-shockwave-flash" id="mpl">
    <param name="src" value="/swf/player_local.swf">
    <param value="false" name="allowfullscreen">
    <param value="transparent" name="wmode">
    <param value="width=955&amp;baseurl=http://www.zippyshare.com/api/&amp;file=Gu68GbCi&amp;server=22&amp;availablequality=both&amp;autostart=false&amp;bordercolor=#cccccc&amp;forecolor=#000000&amp;backcolor=#f2f2f2&amp;darkcolor=#000000&amp;lightcolor=#ff6600" name="flashvars">
    <embed flashvars="width=955&amp;baseurl=http://www.zippyshare.com/api/&amp;file=Gu68GbCi&amp;server=22&amp;availablequality=both&amp;autostart=false&amp;bordercolor=#cccccc&amp;forecolor=#000000&amp;backcolor=#f2f2f2&amp;darkcolor=#000000&amp;lightcolor=#ff6600"
           allowfullscreen="false"
           quality="high"
           name="mpl"
           id="mpl"
           style=""
           src="/swf/player_local.swf"
           type="application/x-shockwave-flash"
           width="955"
           wmode="transparent"
           height="80">
</object>
§
Posted: 06 Februari 2015

to embed the player with mp3 after the link, fot example, i found a script with soundcloud, i want like that on zippyshare too

 

woxxomMod
§
Posted: 06 Februari 2015

Maybe like this:

//assuming linkNode is a DOM node with the zippyshare link

var fileID = linkNode.href.replace(/^.+?\/v\/([a-zA-Z0-9]+)\/.+$/, '$1');
var embedURL = 'width=955&amp;baseurl=http://www.zippyshare.com/api/&amp;file=' + 
    fileID + '&amp;server=22&amp;availablequality=both&amp;autostart=false&amp;bordercolor=#cccccc&amp;forecolor=#000000&amp;backcolor=#f2f2f2&amp;darkcolor=#000000&amp;lightcolor=#ff6600';

linkNode.insertAdjacentHTML('afterend',
    '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="955" height="80" style="visibility: visible;"type="application/x-shockwave-flash" id="mpl">\
        <param name="src" value="http://www.zippyshare.com/swf/player_local.swf">\
        <param value="false" name="allowfullscreen">\
        <param value="transparent" name="wmode">\
        <param value="'+embedURL+'" name="flashvars">\
        <embed flashvars="'+embedURL+'"\
               allowfullscreen="false"\
               quality="high"\
               name="mpl"\
               id="mpl"\
               style=""\
               src="http://www.zippyshare.com/swf/player_local.swf"\
               type="application/x-shockwave-flash"\
               width="955"\
               wmode="transparent"\
               height="80">\
    </object>');
§
Posted: 07 Februari 2015

doesn't work :(
the link has 2 parts that are changing, after www can be other 2 digits and after /v/
examples
http://www51.zippyshare.com/v/94505619/file.html
http://www12.zippyshare.com/v/4iARKFFq/file.html
and i get errors at the embed code

§
Posted: 07 Februari 2015

got something!!! but i want to declare the server number and the file apart
 

woxxomMod
§
Posted: 07 Februari 2015

Well, without seeing the entire script code it's hard to guess what the problem is.

§
Posted: 07 Februari 2015
Edited: 07 Februari 2015

how can i put the code, it's getting eated :D

§
Posted: 07 Februari 2015
Edited: 07 Februari 2015

ok, attached , i'm using Tampermonkey with
// @require http://code.jquery.com/jquery-2.1.3.js

woxxomMod
§
Posted: 07 Februari 2015
Edited: 07 Februari 2015
var regex = /^.+?\/\/www([0-9]+)\.zippyshare\.com\/v\/([a-zA-Z0-9]+)\/[a-zA-Z0-9]+\.[a-zA-Z0-9]+/;

var soundcloud = $("a").filter(function() {
    var m = regex.exec(this.href);
    if (m) {
       this.setAttribute('serverID', m[1]);
       this.setAttribute('fileID', m[2]);
       return true;
    }
});
soundcloud.each(function(){ 
    $(this).after('<embed flashvars="baseurl=https://api.zippyshare.com/api/&amp;file=' + this.getAttribute('fileID') +
                  '&amp;server=' + this.getAttribute('serverID') + '" allowfullscreen="false" quality="high"\
                   wmode="transparent" src="https://api.zippyshare.com/api/player.swf" type="application/x-shockwave-flash"\
                   height="80" width="800" style="display:block">');
});

how can i put the code, it's getting eated :D

to insert multiline code wrap it in <pre> </pre> tags, or <code> </code> for short inline code. You can also switch to Markdown mode (above the comment textbox) and use backquotes: `inline code` or:
`</code><br> multiline<br> code<br> <code>\`

§
Posted: 07 Februari 2015

Finally! Thank you so much!!! Much apreciated!!!

Post reply

Sign in to post a reply.