linterna-magica-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linterna-magica-commit] [406] An attempt to fix bugs #39402.


From: Ivaylo Valkov
Subject: [linterna-magica-commit] [406] An attempt to fix bugs #39402.
Date: Sun, 14 Jul 2013 10:18:06 +0000

Revision: 406
          
http://svn.sv.gnu.org/viewvc/?view=rev&root=linterna-magica&revision=406
Author:   valkov
Date:     2013-07-14 10:18:04 +0000 (Sun, 14 Jul 2013)
Log Message:
-----------
An attempt to fix bugs #39402. Some URLs oppened from Canada has s= instead of 
sig= for signatures.

Ticket Links:
------------
    http://savannah.gnu.org/bugs/?39402

Modified Paths:
--------------
    trunk/src/lm_site_youtube.js

Modified: trunk/src/lm_site_youtube.js
===================================================================
--- trunk/src/lm_site_youtube.js        2013-06-10 20:09:30 UTC (rev 405)
+++ trunk/src/lm_site_youtube.js        2013-07-14 10:18:04 UTC (rev 406)
@@ -260,6 +260,7 @@
 
        fmt = fmt[fmt.length-1].replace(/\\\//g, "/");
        fmt = fmt.split(/,/);
+       this.log("DEBUG: YT fmt split size "+fmt.length);
 
        var links = 0;
 
@@ -268,9 +269,23 @@
            // Usually the links have the following pattern
            // (itag=fmt_id)*url=URL&type=video/...&(itag=fmt_id)*
            var link = fmt[url].match(/(url|conn)=([^&]+)/);
+           this.log("DEBBUG: link "+link);
            var fmt_id = fmt[url].match(/itag=([0-9]+)/);
+           this.log("DEBUG: itag "+fmt_id);
            var sig = fmt[url].replace(/\\u0026/g, '&').match(/sig=[^&]+/);
-               sig = sig[sig.length-1].replace(/sig/,'signature');
+           this.log("DEBUG: sig1: "+sig);
+           sig = sig ? sig[sig.length-1].replace(/sig/,'signature') : '';
+           this.log("DEBUG: sig2: "+sig);
+
+           // Bug 39402. Some links have the signature in the s=<SIG>
+           // format. For example when they are oppened from Canada
+           if (!sig)
+           {
+               sig = fmt[url].replace(/\\u0026/g, '&').match(/s=[^&]+/);
+               this.log("DEBUG: sig3: "+sig);
+               sig = sig ? sig[sig.length-1].replace(/s/,'signature') : '';
+               this.log("DEBUG: sig4: "+sig);
+           }
            
            if (fmt_id && link)
            {
@@ -483,7 +498,7 @@
        this.youtube_flash_upgrade_timeout = setInterval(
            function() {
                self.detect_youtube_flash_upgrade.apply(self,[data]);
-           }, 3000);
+           }, 5000);
     }
     
     return false;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]