[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linterna-magica-commit] [122] Changes for tasks #11216.
From: |
Ivaylo Valkov |
Subject: |
[linterna-magica-commit] [122] Changes for tasks #11216. |
Date: |
Tue, 12 Jul 2011 08:09:21 +0000 |
Revision: 122
http://svn.sv.gnu.org/viewvc/?view=rev&root=linterna-magica&revision=122
Author: valkov
Date: 2011-07-12 08:09:20 +0000 (Tue, 12 Jul 2011)
Log Message:
-----------
Changes for tasks #11216. Added rule to extract HD links from script after
single link is extracted. Small fixes for previous revision (r121) that
extracts HD links from DOM.
Revision Links:
--------------
http://svn.sv.gnu.org/viewvc/?view=rev&root=linterna-magica&revision=121
Ticket Links:
------------
http://savannah.gnu.org/task/?11216
Modified Paths:
--------------
branches/task-11216/src/lm_extract_dom_objects.js
branches/task-11216/src/lm_extract_js_swfobject.js
branches/task-11216/src/lm_site_tedcom.js
branches/task-11216/src/lm_sites.js
Modified: branches/task-11216/src/lm_extract_dom_objects.js
===================================================================
--- branches/task-11216/src/lm_extract_dom_objects.js 2011-07-12 07:49:34 UTC
(rev 121)
+++ branches/task-11216/src/lm_extract_dom_objects.js 2011-07-12 08:09:20 UTC
(rev 122)
@@ -446,7 +446,7 @@
"extract_hd_links_from_dom_if_link",
window.location.hostname, param.value]);
- if (val)
+ if (val && typeof(va) != "boolean")
{
extracted.hd_links = val;
break;
Modified: branches/task-11216/src/lm_extract_js_swfobject.js
===================================================================
--- branches/task-11216/src/lm_extract_js_swfobject.js 2011-07-12 07:49:34 UTC
(rev 121)
+++ branches/task-11216/src/lm_extract_js_swfobject.js 2011-07-12 08:09:20 UTC
(rev 122)
@@ -137,34 +137,21 @@
if (object_data.video_id || object_data.link)
{
- // if (/dailymotion\.com/i.test(window.location.hostname))
- // {
- //
this.log("LinternaMagica.extract_object_from_script_swfobject:\n"+
- // "Trying to extract dailymotion.com HQ links ",1);
- // object_data.hd_links = this.extract_dailymotion_hd_links(data);
-
- // }
- // else
- if (/ted\.com/i.test(window.location.hostname))
- {
- this.log("LinternaMagica.extract_object_from_script_swfobject:\n"+
- "Trying to extract ted.com HQ links ",1);
- object_data.hd_links = this.extract_tedcom_hd_links(data);
- }
- // else if (/myvideo\.de/i.test(window.location.hostname))
- // {
- // // See the comments for this function
- // object_data.link = this.create_myvideode_link();
- // // Now that we have a link remove the video_id
- // // so it is not processed
- // object_data.video_id = null;
- // }
-
this.log("LinternaMagica.extract_object_from_script_swfobject:\n"+
"SWF object extracted from script ",1);
object_data.linterna_magica_id =
this.mark_flash_object("extracted-from-script");
+
+ var self = this;
+ var val = this.call_site_function_at_position.apply(self,[
+ "extract_hd_links_from_script_if_link",
+ window.location.hostname, data]);
+
+ if (val && typeof(va) != "boolean")
+ {
+ object_data.hd_links = val;
+ }
return object_data;
}
Modified: branches/task-11216/src/lm_site_tedcom.js
===================================================================
--- branches/task-11216/src/lm_site_tedcom.js 2011-07-12 07:49:34 UTC (rev
121)
+++ branches/task-11216/src/lm_site_tedcom.js 2011-07-12 08:09:20 UTC (rev
122)
@@ -134,6 +134,15 @@
LinternaMagica.prototype.sites["ted.com"].extract_hd_links_from_dom_if_link =
function(data)
{
+ this.log("LinternaMagica.sites.extract_hd_links_from_dom_if_link:\n"+
+ "Trying to extract ted.com HQ links ",1);
return this.extract_tedcom_hd_links(data);
}
+LinternaMagica.prototype.sites["ted.com"].extract_hd_links_from_script_if_link
=
+function(data)
+{
+ this.log("LinternaMagica.sites.extract_hd_links_from_script_if_link:\n"+
+ "Trying to extract ted.com HQ links ",1);
+ return this.extract_tedcom_hd_links(data);
+}
Modified: branches/task-11216/src/lm_sites.js
===================================================================
--- branches/task-11216/src/lm_sites.js 2011-07-12 07:49:34 UTC (rev 121)
+++ branches/task-11216/src/lm_sites.js 2011-07-12 08:09:20 UTC (rev 122)
@@ -116,16 +116,28 @@
return true;
}
-// Extract HD/HQ links with site specific function and code if a link
+// Extract HD/HQ links from DOM with site specific function and code if a link
// is extracted. See
// lm_site_tedcom.js:extract_hd_links_from_dom_if_link. See comments
// after LinternaMagica.prototype.sites. See
LinternaMagica.prototype.sites.__extract_hd_links_from_dom_if_link =
-function()
+function(data)
{
return true;
}
+// Extract HD/HQ links from script with site specific function and code if a
link
+// is extracted. See
+// lm_site_tedcom.js:extract_hd_links_from_dom_if_link. See comments
+// after LinternaMagica.prototype.sites. See
+LinternaMagica.prototype.sites.__extract_hd_links_from_script_if_link =
+function(data)
+{
+ return true;
+}
+
+
+
// LinternaMagica.prototype.sites.__extract_scripts_extract_when // Condition
? DM /ted?
// LinternaMagica.prototype.sites.__extract_scripts_once // YT ?
// LinternaMagica.prototype.sites.__extract_scripts_wait_insert // FB
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [linterna-magica-commit] [122] Changes for tasks #11216.,
Ivaylo Valkov <=