Script code function

Asked

Viewed 143 times

0

Could someone explain to me what the part that says means in this code:

document.cookie = 'useHTML5=; expires=Thu, 01 Jan 1970 00:00:01

It appears more than once, I wonder if it is something related to a valid script date, and why the year 1970

In the script also has some encoded links, I decrypted some and in all of them appears the part (expire)

https://redirector.googlevideo.com/videoplayback?requiressl=yes&shardbypass=yes&cmbypass=yes&id=a65e10712772b860&itag=37&source=picasa&cmo=secure_transport=yes&ip=0.0.0.0&ipbits=0expire=0expire=1410146288&sparams=requiressl,shardbypass,bypass,id,itag,source,ip,ipipbits,expire&signature=520E18C71BF843019359E7EB492F8CBD928385BD.35D96C19784732AC04B057DC838BC70B21E467D7&key=lh1

Already on that other link the part that refers expire is different

http://redirector.googlevideo.com/videoplayback?id=d4f4531d811f6fc8&itag=18&source=picasa&cmo=sensitive_content=yes&ip=0.0.0&ipbits=0expire&=1407845352&sparams=id,itag source,,,ip,ipbits,expire&signature=CBB7533D638BE53685D14770144A4808C129B264.275AA97CABC08AB6AD4BC8780EC905DCA9989D9A&key=lh1

This script would have the function of changing that date or something like that?

<script type="text/javascript">
        $(document).ready(function () {
            $("#divContentVideo").allofthelights({
                'opacity': '0.95',
                'clickable_bg': 'true',
                'callback_turn_off': function() {
                    $('.allofthelights_bg').hide().show(0);
                    $('#switch').hide();
                },
                'callback_turn_on': function() {
                    $('#switch').show();
                }
            });


            setTimeout('ReloadIfNeed()', 10000);

        });

        function ReloadIfNeed(){
            if ($('#divFileName').html().indexOf("My Movie") > 0)
            {
                location.reload();
            }
        }


        var isHTML5 = false;
        if (document.cookie.indexOf("useHTML5") >= 0) {
            isHTML5 = true;
            $('#playerChoose').html('-> Switch to Flash Player (more stable & better quality)');
            $('#qualityChoose').show();
        }

        var isHTML5HQ = false;
        if (document.cookie.indexOf("isHTML5HQ") >= 0) {
            isHTML5HQ = true;
            $('#qualityChoose').html('-> Switch to HTML5 LOW quality');
        }

        $('#playerChoose').click(function () {
            if (isHTML5)
            {
                document.cookie = 'useHTML5=; expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/';
                document.cookie = 'useFlash=true;path=/';
            }
            else
            {
                document.cookie = 'useHTML5=true;path=/';
                document.cookie = 'useFlash=; expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/';
            }

            document.location.reload(true);
        });

        $('#qualityChoose').click(function () {
            if (isHTML5HQ)
            {
                document.cookie = 'isHTML5HQ=; expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/';
                document.cookie = 'isHTML5LQ=true;path=/';
            }
            else
            {
                document.cookie = 'isHTML5HQ=true;path=/';
                document.cookie = 'isHTML5LQ=; expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/';
            }

            document.location.reload(true);
        });

        var txha = 'fmt_list=37%2F1920x1080%2C22%2F1280x720%2C35%2F854x480%2C34%2F640x360%2C18%2F640x360&amp;fmt_stream_map=37%7Chttps%3a%2f%2fredirector.googlevideo.com%2fvideoplayback%3frequiressl%3dyes%26shardbypass%3dyes%26cmbypass%3dyes%26id%3da65e10712772b860%26itag%3d37%26source%3dpicasa%26cmo%3dsecure_transport%3dyes%26ip%3d0.0.0.0%26ipbits%3d0%26expire%3d1410146288%26sparams%3drequiressl%252Cshardbypass%252Ccmbypass%252Cid%252Citag%252Csource%252Cip%252Cipbits%252Cexpire%26signature%3d520E18C71BF843019359E7EB492F8CBD928385BD.35D96C19784732AC04B057DC838BC70B21E467D7%26key%3dlh1%2C22%7Chttps%3a%2f%2fredirector.googlevideo.com%2fvideoplayback%3frequiressl%3dyes%26shardbypass%3dyes%26cmbypass%3dyes%26id%3da65e10712772b860%26itag%3d22%26source%3dpicasa%26cmo%3dsecure_transport%3dyes%26ip%3d0.0.0.0%26ipbits%3d0%26expire%3d1410146288%26sparams%3drequiressl%252Cshardbypass%252Ccmbypass%252Cid%252Citag%252Csource%252Cip%252Cipbits%252Cexpire%26signature%3d11DBC00A15B49979B0B9A23004174EF4FFF7A925.32E74A92AEE34FADEC0096642702584FD658DBBF%26key%3dlh1%2C35%7Chttps%3a%2f%2fredirector.googlevideo.com%2fvideoplayback%3frequiressl%3dyes%26shardbypass%3dyes%26cmbypass%3dyes%26id%3da65e10712772b860%26itag%3d35%26source%3dpicasa%26cmo%3dsecure_transport%3dyes%26ip%3d0.0.0.0%26ipbits%3d0%26expire%3d1410146288%26sparams%3drequiressl%252Cshardbypass%252Ccmbypass%252Cid%252Citag%252Csource%252Cip%252Cipbits%252Cexpire%26signature%3dABE28CFF2DF9768DDCBEBC525145903668D9A9F6.CC31D9AC79E0EF78E20C88DDCEC6D1B537E68268%26key%3dlh1%2C34%7Chttps%3a%2f%2fredirector.googlevideo.com%2fvideoplayback%3frequiressl%3dyes%26shardbypass%3dyes%26cmbypass%3dyes%26id%3da65e10712772b860%26itag%3d34%26source%3dpicasa%26cmo%3dsecure_transport%3dyes%26ip%3d0.0.0.0%26ipbits%3d0%26expire%3d1410146288%26sparams%3drequiressl%252Cshardbypass%252Ccmbypass%252Cid%252Citag%252Csource%252Cip%252Cipbits%252Cexpire%26signature%3d700BCAB38FAB60AD6AABC3549B9E7C74D3ED489C.57F7DC1FC5A065786DB4F2E6277D1546D54ACF2B%26key%3dlh1%2C18%7Chttps%3a%2f%2fredirector.googlevideo.com%2fvideoplayback%3frequiressl%3dyes%26shardbypass%3dyes%26cmbypass%3dyes%26id%3da65e10712772b860%26itag%3d18%26source%3dpicasa%26cmo%3dsecure_transport%3dyes%26ip%3d0.0.0.0%26ipbits%3d0%26expire%3d1410146288%26sparams%3drequiressl%252Cshardbypass%252Ccmbypass%252Cid%252Citag%252Csource%252Cip%252Cipbits%252Cexpire%26signature%3d270F5022125B383BF7365840657C61CB83505AA5.97F4F9604EEDEBE76CC22625C2F8AAE4761D0970%26key%3dlh1&amp;video_id=picasacid&amp;fs=1&amp;hl=en&amp;autoplay=1&amp;ps=picasaweb&amp;playerapiid=uniquePlayerId&amp;t=1&amp;vq=large&amp;auth_timeout=86400000000';


        $('#selectEpisode').change(function () {
            location.href = 'http://kissanime.com/Anime/K-On-2-Dub/' + $(this).val();
        });

        $('#selectGroup').change(function () {
            location.href = 'http://kissanime.com/Anime/' + $(this).val();
        });


        if (isHTML5) {
            $('#divContentVideo').html('<video id="my_video_1" class="video-js vjs-default-skin" controls autoplay preload="auto" width="854px" height="552px" data-setup="{}"><source src="' + txha + '" type="video/mp4"></video>');            
            //$('#divContentVideo').html('<div style="position: relative;width:100%;height:100%"><div data-swf="//releases.flowplayer.org/5.4.3/flowplayer.swf" class="flowplayer play-button" style="position: absolute; bottom: 0;" data-embed="false"><video preload="auto" autoplay><source type="video/mp4" src="' + txha + '"/></video></div></div>');
            $('#divTextQua').html('IF THE PLAYER DOES NOT WORK, PLEASE CLICK ON THE URLS BELOW TO WATCH VIDEO');            


                $('#switch').css('left', '860px');
                $('#switch').css('top', '530px');

        }
        else
        {
            //$('#divContentVideo').show();
            setTimeout('DoHideFake()', 2000);
        }

        function DoHideFake()
        {
            $('#divContentVideo').append('<embed id="embedVideo" height="552" src="//www.youtube.com/get_player?enablejsapi=1&modestbranding=1"type="application/x-shockwave-flash" width="854" allowfullscreen="true" allowscriptaccess="always" bgcolor="#fff" scale="noScale" wmode="opaque" flashvars="' + txha + '" style="width: 854px; height: 552px" />');
        }


        function NextEps() {
            $('#divMsg').css('display', 'block');
        }



    </script>

1 answer

3

In your code is removing the cookie, the date is to force the removal.

• useHTML5 = ''
• expires = Thu, 01 Jan 1970 00:00:01

That is to say, useHTML5 without an assigned value - null, and the date of the cookie already expired.
In this case the cookie is simply deleted.

Why set the date in 1970?

The date Thu, 01 Jan 1970 00:00:01 ensures that the cookie is removed, even if the user’s computed date is not the current date. If the user changes the date of the PC, 1970 ensures the removal without conflict of date.



An example for cookie creation valid until the end of the year.

document.cookie="username=John Doe; expires=Thu, 18 Dec 2014 12:00:00 GMT";

[reference]


The googlevideo URL probably loads the player controls.

  • But the date of 1970 ??? was then already valid, I added another information, from a look

  • Could you get that script up and running, see if it works? , I tested it on http://jsfiddle.net/ didn’t work, does it need any div?

  • You certainly need the HTML elements... The code is full of reference by Divs, see $("#divContentVideo"), $('#divFileName')... among many others. What would be the doubt in question? It is not working, it presents error...?

  • I’m trying to embed my videos that are housed in picasaweb, and in a forum I was shown this site: http://kissanime.com/Anime/K-On-2-Dub/Episode-001?id=79216 I thought it would be easy, but I can’t understand how this site does.

  • There are components in jQuery to load videos, but this I think falls outside the scope of your initial question. I recommend downloading some to test.

  • Okay, I’ll see if I can find something on the site

  • This is the feed https://picasaweb.google.com/data/feedy/user/100642868990821651444/photoid/5720909218315234178?alt=jsonm&urlredir=1&commentreason=1&fd=shapes&thumbsize=d&max-Results=100&callback=picasa_callback&t=391155 it has the links to the video it would take a while to use it to load the videos I found something on this link but it is for yotube http://answall.com/questions/21616/inserir-automaticamentev%C3%Addeo-do-youtube-em-uma-div

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.