Script code function

0

Someone could explain to me what this code means in the part that says:

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

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

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

link

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

= 1407845352 & sparams = id, itag, source, ip, ipbits, expire & signature = CBB7533D638BE53685D14770144A4808C129B264.275AA97CABC08AB6AD4BC8780EC905DCA9989D9A & key = lh1 "> link

Would this script have the function to change that date or something?

<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>
    
asked by anonymous 16.08.2014 / 04:22

1 answer

3

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

  

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

That is, useHTML5 without a value assigned - 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 date of the user's computer 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 creating cookie with validity by 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.

    
16.08.2014 / 04:42