1 require("content-buffer.js");
4 const media_youporn_title_regexp = /^.*? - (.*)$/;
5 const media_youporn_flv_regexp = /var player_url = '(.*?)';/;
7 function media_scrape_youporn(buffer) {
9 var doc = buffer.document;
11 var title = doc.title;
12 var usable_title_res = media_youporn_title_regexp.exec(title);
13 var usable_title = usable_title_res[0];
15 let text = doc.documentElement.innerHTML;
16 let res = media_youporn_flv_regexp.exec(text);
19 return [load_spec({uri: res[1],
20 suggest_filename_from_uri: false,
22 filename_extension: "flv",
23 source_frame: buffer.top_frame,
24 mime_type: "video/x-flv"})];
26 } catch (e if !(e instanceof interactive_error)) {}
30 define_page_mode("youporn_mode", "YouPorn", $enable = function (buffer) {
31 buffer.local_variables.media_scraper = media_scrape_youporn;
32 media_setup_local_object_classes(buffer);
35 auto_mode_list.push([/^http:\/\/youporn\.com\//, youporn_mode]);