diff --git a/lib/Plagger/Plugin.pm b/lib/Plagger/Plugin.pm index ea4a79c4..be3883c1 100644 --- a/lib/Plagger/Plugin.pm +++ b/lib/Plagger/Plugin.pm @@ -46,21 +46,23 @@ sub plugin_id { sub assets_dir { my $self = shift; - my $context = Plagger->context; - if ($self->conf->{assets_path}) { - return $self->conf->{assets_path}; # look at config:assets_path first - } + my $context = Plagger->context; my $assets_base = $context->conf->{assets_path} || # or global:assets_path File::Spec->catfile($FindBin::Bin, "assets"); # or "assets" under plagger script return File::Spec->catfile( - $assets_base, "plugins", $self->class_id, + $assets_base, "plugins", ); } +sub asset_key { + my $self = shift; + return $self->plugin_id; +} + sub log { my $self = shift; Plagger->context->log(@_, caller => ref($self)); @@ -78,11 +80,10 @@ sub cookie_jar { } sub load_assets { - my($self, $rule, $callback) = @_; + my($self, $ext, $callback) = @_; - unless (blessed($rule) && $rule->isa('File::Find::Rule')) { - $rule = File::Find::Rule->name($rule)->extras({follow => 1}); - } + my $key = $self->asset_key; + my $rule = File::Find::Rule->name("$key*.$ext")->extras({ follow => 1 }); # ignore .svn directories $rule->or( @@ -91,28 +92,31 @@ sub load_assets { ); # $rule isa File::Find::Rule - for my $file ($rule->in($self->assets_dir)) { - my $base = File::Basename::basename($file); - $callback->($file, $base); + my $assets_dir = $self->assets_dir; + for my $file ($rule->in($assets_dir)) { + my $domain = File::Basename::dirname($file); + $domain =~ s/^$assets_dir\///; + $domain = '*' if $domain eq 'default'; + $callback->($file, $domain); } } -sub add_plugin { +sub add_asset { my $self = shift; my($plugin) = @_; my $domain = $plugin->{domain} || '*'; - push @{ $self->{plugins}->{$domain} }, $plugin; + push @{ $self->{assets}->{$domain} }, $plugin; } -sub plugin_for { +sub asset_for { my $self = shift; my($url) = @_; - return $self->plugins_for($url, 1); + return $self->assets_for($url, 1); } -sub plugins_for { +sub assets_for { my $self = shift; my($url, $first) = @_; @@ -125,22 +129,22 @@ sub plugins_for { my @try = map join(".", @domain[$_..$#domain]), 0..$#domain-1; push @try, '*'; - my @plugins; + my @assets; for my $try (@try) { - my $plugins = $self->{plugins}->{$try} || []; - for my $plugin (@{$plugins}) { + my $assets = $self->{assets}->{$try} || []; + for my $plugin (@{$assets}) { my $re = $plugin->{handle} || "."; my $test = $re =~ m!https?://! ? $uri : $uri->path_query; if ($test =~ /$re/i) { - $self->log(debug => "Handle $uri with plugin " . $plugin->site_name); + $self->log(debug => "Handle $uri with plugin " . $plugin->{domain}); return $plugin if $first; - push @plugins, $plugin; + push @assets, $plugin; } } } return if $first; - return @plugins; + return @assets; } 1; diff --git a/lib/Plagger/Plugin/CustomFeed/FindLinks.pm b/lib/Plagger/Plugin/CustomFeed/FindLinks.pm index d06c3443..ac72e0b4 100644 --- a/lib/Plagger/Plugin/CustomFeed/FindLinks.pm +++ b/lib/Plagger/Plugin/CustomFeed/FindLinks.pm @@ -22,27 +22,29 @@ sub register { sub init { my $self = shift; $self->SUPER::init(@_); - $self->load_assets('*.yaml', sub { $self->load_plugin_yaml(@_) }); + $self->load_assets('yaml', sub { $self->load_plugin_yaml(@_) }); $self->{ua} = Plagger::UserAgent->new; } +sub asset_key { 'find_links' } + sub load_plugin_yaml { - my($self, $file, $base) = @_; + my($self, $file, $domain) = @_; Plagger->context->log(debug => "Load YAML $file"); my @data = YAML::LoadFile($file); for my $data (@data) { - my $plugin = Plagger::Plugin::Filter::FindLinks::YAML->new($data, $base); - $self->add_plugin($plugin); + my $plugin = Plagger::Plugin::Filter::FindLinks::YAML->new($data, $domain); + $self->add_asset($plugin); } } sub handle { my($self, $context, $args) = @_; - my $handler = $self->plugin_for($args->{feed}->url); + my $handler = $self->asset_for($args->{feed}->url); if ($handler) { $args->{match} = $handler->follow_link; $args->{xpath} = $handler->follow_xpath; @@ -140,7 +142,7 @@ use Encode; use List::Util qw(first); sub new { - my($class, $data, $base) = @_; + my($class, $data, $domain) = @_; # add ^ if handle method starts with http:// for my $key ( qw(handle handle_force) ) { @@ -148,12 +150,7 @@ sub new { $data->{$key} = "^$data->{$key}" if $data->{$key} =~ m!^https?://!; } - bless {%$data, base => $base }, $class; -} - -sub site_name { - my $self = shift; - $self->{base}; + bless {%$data, domain => $domain }, $class; } sub follow_link { diff --git a/root/plugins/CustomFeed-FindLinks/davestrailer.yaml b/root/plugins/74.53.95.28/find_links.yaml similarity index 87% rename from root/plugins/CustomFeed-FindLinks/davestrailer.yaml rename to root/plugins/74.53.95.28/find_links.yaml index fe55df86..ac7a8101 100644 --- a/root/plugins/CustomFeed-FindLinks/davestrailer.yaml +++ b/root/plugins/74.53.95.28/find_links.yaml @@ -1,5 +1,4 @@ author: Tatsuhiko Miyagawa -domain: 74.53.95.28 follow_xpath: //a[contains(text(), "720P")] # TODO item title becomes "HD 720P" and not movie title :/ diff --git a/root/plugins/CustomFeed-FindLinks/impresswatch.yaml b/root/plugins/CustomFeed-FindLinks/impresswatch.yaml deleted file mode 100644 index 23bcc37e..00000000 --- a/root/plugins/CustomFeed-FindLinks/impresswatch.yaml +++ /dev/null @@ -1,3 +0,0 @@ -domain: video.watch.impress.co.jp -handle: . -follow_link: flash.htm diff --git a/root/plugins/Filter-FindEnclosures/livedooranime.pl b/root/plugins/anime.livedoor.com/find_enclosures.pl similarity index 90% rename from root/plugins/Filter-FindEnclosures/livedooranime.pl rename to root/plugins/anime.livedoor.com/find_enclosures.pl index 07cf3dfe..5faf1560 100644 --- a/root/plugins/Filter-FindEnclosures/livedooranime.pl +++ b/root/plugins/anime.livedoor.com/find_enclosures.pl @@ -1,6 +1,5 @@ sub init { my $self = shift; - $self->{domain} = "anime.livedoor.com"; $self->{handle} = "movie"; } diff --git a/root/plugins/Filter-FindEnclosures/appletrailers.pl b/root/plugins/apple.com/find_enclosures.pl similarity index 93% rename from root/plugins/Filter-FindEnclosures/appletrailers.pl rename to root/plugins/apple.com/find_enclosures.pl index 20d355ae..d4e26a9e 100644 --- a/root/plugins/Filter-FindEnclosures/appletrailers.pl +++ b/root/plugins/apple.com/find_enclosures.pl @@ -3,7 +3,6 @@ use Web::Scraper; sub init { my $self = shift; - $self->{domain} = "www.apple.com"; $self->{handle} = "/trailers/"; } diff --git a/root/plugins/Filter-FindEnclosures/asahicom.pl b/root/plugins/asahi.com/find_enclosures.pl similarity index 93% rename from root/plugins/Filter-FindEnclosures/asahicom.pl rename to root/plugins/asahi.com/find_enclosures.pl index 47146407..e4c3cd57 100644 --- a/root/plugins/Filter-FindEnclosures/asahicom.pl +++ b/root/plugins/asahi.com/find_enclosures.pl @@ -1,7 +1,6 @@ # author: Tatsuhiko Miyagawa sub init { my $self = shift; - $self->{domain} = "www.asahi.com"; $self->{handle} = 'video/\w+/\w{3}\d+\.html'; } diff --git a/root/plugins/CustomFeed-FindLinks/asahicom.yaml b/root/plugins/asahi.com/find_links.yaml similarity index 83% rename from root/plugins/CustomFeed-FindLinks/asahicom.yaml rename to root/plugins/asahi.com/find_links.yaml index 492f3c74..d3a58be4 100644 --- a/root/plugins/CustomFeed-FindLinks/asahicom.yaml +++ b/root/plugins/asahi.com/find_links.yaml @@ -1,5 +1,4 @@ # upgrades http://www.asahi.com/video/list.html # author: otsune -domain: www.asahi.com handle: /video follow_link: \w{3}\d{12}\.html diff --git a/root/plugins/Filter-FindEnclosures/cancamtv.pl b/root/plugins/cancam.tv/find_enclosures.pl similarity index 93% rename from root/plugins/Filter-FindEnclosures/cancamtv.pl rename to root/plugins/cancam.tv/find_enclosures.pl index 51267ea3..a38d2e3d 100644 --- a/root/plugins/Filter-FindEnclosures/cancamtv.pl +++ b/root/plugins/cancam.tv/find_enclosures.pl @@ -2,7 +2,6 @@ # author: Tatsuhiko Miyagawa sub init { my $self = shift; - $self->{domain} = "cancam.tv"; $self->{handle} = "/content/models_room"; } diff --git a/root/plugins/Filter-FindEnclosures/cbsnews.pl b/root/plugins/cbsnews.com/find_enclosures.pl similarity index 94% rename from root/plugins/Filter-FindEnclosures/cbsnews.pl rename to root/plugins/cbsnews.com/find_enclosures.pl index d31fdfae..278e1e7f 100644 --- a/root/plugins/Filter-FindEnclosures/cbsnews.pl +++ b/root/plugins/cbsnews.com/find_enclosures.pl @@ -2,7 +2,6 @@ # e.g. http://feeds.cbsnews.com/CBSNewsVideoEveningNews sub init { my $self = shift; - $self->{domain} = "cbsnews.com"; $self->{handle} = "/video/watch/"; } diff --git a/root/plugins/Filter-FindEnclosures/pandoratv.pl b/root/plugins/channel.pandora.tv/find_enclosures.pl similarity index 96% rename from root/plugins/Filter-FindEnclosures/pandoratv.pl rename to root/plugins/channel.pandora.tv/find_enclosures.pl index f3226477..c4dd2cbf 100644 --- a/root/plugins/Filter-FindEnclosures/pandoratv.pl +++ b/root/plugins/channel.pandora.tv/find_enclosures.pl @@ -3,7 +3,6 @@ sub init { my $self = shift; - $self->{domain} = "channel.pandora.tv"; $self->{handle} = "channel/video.ptv"; } diff --git a/root/plugins/Filter-FindEnclosures/colbertnation.pl b/root/plugins/colbertnation.com/find_enclosures.pl similarity index 91% rename from root/plugins/Filter-FindEnclosures/colbertnation.pl rename to root/plugins/colbertnation.com/find_enclosures.pl index e4f796ff..e7b63e84 100644 --- a/root/plugins/Filter-FindEnclosures/colbertnation.pl +++ b/root/plugins/colbertnation.com/find_enclosures.pl @@ -1,7 +1,6 @@ # author: Tatsuhiko Miyagawa sub init { my $self = shift; - $self->{domain} = "colbertnation.com"; $self->{handle} = 'videos/\d+'; } diff --git a/root/plugins/Filter-FindEnclosures/comedycentral.pl b/root/plugins/comedycentral.com/find_enclosures.pl similarity index 92% rename from root/plugins/Filter-FindEnclosures/comedycentral.pl rename to root/plugins/comedycentral.com/find_enclosures.pl index dc9c1dc4..9a16ddb8 100644 --- a/root/plugins/Filter-FindEnclosures/comedycentral.pl +++ b/root/plugins/comedycentral.com/find_enclosures.pl @@ -1,7 +1,6 @@ # author: Tatsuhiko Miyagawa sub init { my $self = shift; - $self->{domain} = "comedycentral.com"; $self->{handle} = 'videos/index\.jhtml\?videoId='; } diff --git a/root/plugins/Filter-FindEnclosures/currenttv.pl b/root/plugins/current.com/find_enclosures.pl similarity index 93% rename from root/plugins/Filter-FindEnclosures/currenttv.pl rename to root/plugins/current.com/find_enclosures.pl index 0d0e4ad4..68d53a5e 100644 --- a/root/plugins/Filter-FindEnclosures/currenttv.pl +++ b/root/plugins/current.com/find_enclosures.pl @@ -2,7 +2,6 @@ sub init { my $self = shift; - $self->{domain} = "current.com"; $self->{handle} = '/items/\d+/'; } diff --git a/root/plugins/CustomFeed-FindLinks/currenttv.yaml b/root/plugins/current.com/find_links.yaml similarity index 83% rename from root/plugins/CustomFeed-FindLinks/currenttv.yaml rename to root/plugins/current.com/find_links.yaml index c0b0ac67..398ed04b 100644 --- a/root/plugins/CustomFeed-FindLinks/currenttv.yaml +++ b/root/plugins/current.com/find_links.yaml @@ -1,5 +1,4 @@ # upgrades http://www.asahi.com/video/list.html # author: otsune -domain: current.com handle: . follow_link: /items/\d+/ diff --git a/root/plugins/Filter-FindEnclosures/dailymotion.pl b/root/plugins/dailymotion.com/find_enclosures.pl similarity index 95% rename from root/plugins/Filter-FindEnclosures/dailymotion.pl rename to root/plugins/dailymotion.com/find_enclosures.pl index 41e0ab05..3220b6be 100644 --- a/root/plugins/Filter-FindEnclosures/dailymotion.pl +++ b/root/plugins/dailymotion.com/find_enclosures.pl @@ -2,7 +2,6 @@ sub init { my $self = shift; - $self->{domain} = "dailymotion.com"; $self->{handle} = "/video/"; } diff --git a/root/plugins/Filter-FindEnclosures/asx.pl b/root/plugins/default/asx.pl similarity index 97% rename from root/plugins/Filter-FindEnclosures/asx.pl rename to root/plugins/default/asx.pl index af988c8e..11a2ad16 100644 --- a/root/plugins/Filter-FindEnclosures/asx.pl +++ b/root/plugins/default/asx.pl @@ -2,7 +2,6 @@ use XML::LibXML; sub init { my $self = shift; - $self->{domain} = "*"; $self->{handle} = "\.asx"; # XXX this really needs to be the handle for upgrade, not find } diff --git a/root/plugins/Filter-FindEnclosures/eyevio.pl b/root/plugins/eyevio.jp/find_enclosures.pl similarity index 93% rename from root/plugins/Filter-FindEnclosures/eyevio.pl rename to root/plugins/eyevio.jp/find_enclosures.pl index f6bab154..4ddc1f9d 100644 --- a/root/plugins/Filter-FindEnclosures/eyevio.pl +++ b/root/plugins/eyevio.jp/find_enclosures.pl @@ -2,7 +2,6 @@ # TODO replace the original video/3gpp sub init { my $self = shift; - $self->{domain} = "eyevio.jp"; $self->{handle} = "/movie/"; } diff --git a/root/plugins/Filter-FindEnclosures/fnn_news.pl b/root/plugins/fnn-news.com/find_enclosures.pl similarity index 93% rename from root/plugins/Filter-FindEnclosures/fnn_news.pl rename to root/plugins/fnn-news.com/find_enclosures.pl index 471ddd11..4089196b 100644 --- a/root/plugins/Filter-FindEnclosures/fnn_news.pl +++ b/root/plugins/fnn-news.com/find_enclosures.pl @@ -1,7 +1,6 @@ # author: Tatsuhiko Miyagawa sub init { my $self = shift; - $self->{domain} = "fnn-news.com"; $self->{handle} = "/news/headlines/articles"; } diff --git a/root/plugins/CustomFeed-FindLinks/fnn_news.yaml b/root/plugins/fnn-news.com/find_links.yaml similarity index 88% rename from root/plugins/CustomFeed-FindLinks/fnn_news.yaml rename to root/plugins/fnn-news.com/find_links.yaml index dd1b161d..e1e01dd3 100644 --- a/root/plugins/CustomFeed-FindLinks/fnn_news.yaml +++ b/root/plugins/fnn-news.com/find_links.yaml @@ -1,5 +1,4 @@ # upgrades http://www.fnn-news.com/news/headlines/category05.html # check "Skip RSS discovery" -domain: fnn-news.com handle: /news/headlines/ follow_link: /news/headlines/articles/ diff --git a/root/plugins/Filter-FindEnclosures/funnyordie.pl b/root/plugins/funnyordie.com/find_enclosures.pl similarity index 96% rename from root/plugins/Filter-FindEnclosures/funnyordie.pl rename to root/plugins/funnyordie.com/find_enclosures.pl index 19f6c7cc..bc1a94a3 100644 --- a/root/plugins/Filter-FindEnclosures/funnyordie.pl +++ b/root/plugins/funnyordie.com/find_enclosures.pl @@ -1,7 +1,6 @@ # author: Tatsuhiko Miyagawa sub init { my $self = shift; - $self->{domain} = "funnyordie.com"; $self->{handle} = 'videos/\w+/'; } diff --git a/root/plugins/Filter-FindEnclosures/gametrailers.pl b/root/plugins/gametrailers.com/find_enclosures.pl similarity index 96% rename from root/plugins/Filter-FindEnclosures/gametrailers.pl rename to root/plugins/gametrailers.com/find_enclosures.pl index 571499b0..ece032de 100644 --- a/root/plugins/Filter-FindEnclosures/gametrailers.pl +++ b/root/plugins/gametrailers.com/find_enclosures.pl @@ -1,7 +1,6 @@ # upgrades http://www.gametrailers.com/rssgenerate.php?game1id=6364&orderby=newest&limit=20 sub init { my $self = shift; - $self->{domain} = "gametrailers.com"; $self->{handle} = '/player/\d+.html'; } diff --git a/root/plugins/Filter-FindEnclosures/joost.pl b/root/plugins/joost.com/find_enclosures.pl similarity index 95% rename from root/plugins/Filter-FindEnclosures/joost.pl rename to root/plugins/joost.com/find_enclosures.pl index ca7cd2a9..0a8c3a08 100644 --- a/root/plugins/Filter-FindEnclosures/joost.pl +++ b/root/plugins/joost.com/find_enclosures.pl @@ -1,6 +1,5 @@ sub init { my $self = shift; - $self->{domain} = "joost.com"; $self->{handle} = "."; } diff --git a/root/plugins/CustomFeed-FindLinks/lantis.yaml b/root/plugins/lantis-net.com/find_links.yaml similarity index 68% rename from root/plugins/CustomFeed-FindLinks/lantis.yaml rename to root/plugins/lantis-net.com/find_links.yaml index 0feb7af6..597219e8 100644 --- a/root/plugins/CustomFeed-FindLinks/lantis.yaml +++ b/root/plugins/lantis-net.com/find_links.yaml @@ -1,5 +1,4 @@ author: Tatsuhiko Miyagawa -domain: lantis-net.com follow_link: h.asx diff --git a/root/plugins/CustomFeed-FindLinks/macross.yaml b/root/plugins/macrossf.com/find_links.yaml similarity index 79% rename from root/plugins/CustomFeed-FindLinks/macross.yaml rename to root/plugins/macrossf.com/find_links.yaml index 2eeb7e3d..03e9e4ce 100644 --- a/root/plugins/CustomFeed-FindLinks/macross.yaml +++ b/root/plugins/macrossf.com/find_links.yaml @@ -1,5 +1,4 @@ author: Tatsuhiko Miyagawa -domain: macrossf.com handle: /radio/radio.html follow_link: 500k.asx diff --git a/root/plugins/Filter-FindEnclosures/mitter.pl b/root/plugins/mitter.jp/find_enclosures.pl similarity index 92% rename from root/plugins/Filter-FindEnclosures/mitter.pl rename to root/plugins/mitter.jp/find_enclosures.pl index cf7dab26..590f0861 100644 --- a/root/plugins/Filter-FindEnclosures/mitter.pl +++ b/root/plugins/mitter.jp/find_enclosures.pl @@ -1,7 +1,6 @@ use Web::Scraper; sub init { my $self = shift; - $self->{domain} = "mitter.jp"; $self->{handle} = '/watched/\d+'; } diff --git a/root/plugins/Filter-FindEnclosures/mtvmusic.pl b/root/plugins/mtvmusic.com/find_enclosures.pl similarity index 92% rename from root/plugins/Filter-FindEnclosures/mtvmusic.pl rename to root/plugins/mtvmusic.com/find_enclosures.pl index 9e3cba16..db9e3644 100644 --- a/root/plugins/Filter-FindEnclosures/mtvmusic.pl +++ b/root/plugins/mtvmusic.com/find_enclosures.pl @@ -1,7 +1,6 @@ # author: Tatsuhiko Miyagawa sub init { my $self = shift; - $self->{domain} = "mtvmusic.com"; $self->{handle} = 'videos/\d+'; } diff --git a/root/plugins/CustomFeed-FindLinks/mtvmusic.yaml b/root/plugins/mtvmusic.com/find_links.yaml similarity index 55% rename from root/plugins/CustomFeed-FindLinks/mtvmusic.yaml rename to root/plugins/mtvmusic.com/find_links.yaml index 495a7b48..de487373 100644 --- a/root/plugins/CustomFeed-FindLinks/mtvmusic.yaml +++ b/root/plugins/mtvmusic.com/find_links.yaml @@ -1,3 +1,2 @@ -domain: mtvmusic.com follow_link: videos/\d+/ diff --git a/root/plugins/Filter-FindEnclosures/tbs_news.pl b/root/plugins/news.tbs.co.jp/find_enclosures.pl similarity index 92% rename from root/plugins/Filter-FindEnclosures/tbs_news.pl rename to root/plugins/news.tbs.co.jp/find_enclosures.pl index 40ab5e59..5fe61f77 100644 --- a/root/plugins/Filter-FindEnclosures/tbs_news.pl +++ b/root/plugins/news.tbs.co.jp/find_enclosures.pl @@ -1,7 +1,6 @@ # author: Tatsuhiko Miyagawa sub init { my $self = shift; - $self->{domain} = "news.tbs.co.jp"; $self->{handle} = "/newseye/"; } diff --git a/root/plugins/CustomFeed-FindLinks/tbs_news.yaml b/root/plugins/news.tbs.co.jp/find_links.yaml similarity index 88% rename from root/plugins/CustomFeed-FindLinks/tbs_news.yaml rename to root/plugins/news.tbs.co.jp/find_links.yaml index 46885bfb..e4ba9a09 100644 --- a/root/plugins/CustomFeed-FindLinks/tbs_news.yaml +++ b/root/plugins/news.tbs.co.jp/find_links.yaml @@ -1,5 +1,4 @@ # upgrades http://news.tbs.co.jp/society/ # check "Skip RSS discovery" -domain: news.tbs.co.jp handle: . follow_xpath: //a[contains(@href,"/newseye/tbs_newseye") and not(contains(text(), "続きを読む"))] diff --git a/root/plugins/Filter-FindEnclosures/netstar.pl b/root/plugins/nhk-ep.co.jp/find_enclosures.pl similarity index 93% rename from root/plugins/Filter-FindEnclosures/netstar.pl rename to root/plugins/nhk-ep.co.jp/find_enclosures.pl index 2ae3d369..e5eb8237 100644 --- a/root/plugins/Filter-FindEnclosures/netstar.pl +++ b/root/plugins/nhk-ep.co.jp/find_enclosures.pl @@ -1,7 +1,6 @@ # author: Tatsuhiko Miyagawa sub init { my $self = shift; - $self->{domain} = "www.nhk-ep.co.jp"; $self->{handle} = "/netstar/.*mov_"; } diff --git a/root/plugins/CustomFeed-FindLinks/netstar.yaml b/root/plugins/nhk-ep.co.jp/find_links.yaml similarity index 85% rename from root/plugins/CustomFeed-FindLinks/netstar.yaml rename to root/plugins/nhk-ep.co.jp/find_links.yaml index 98cf6557..8cf73572 100644 --- a/root/plugins/CustomFeed-FindLinks/netstar.yaml +++ b/root/plugins/nhk-ep.co.jp/find_links.yaml @@ -1,5 +1,4 @@ author: Tatsuhiko Miyagawa -domain: www.nhk-ep.co.jp handle: /netstar/ follow_link: mov_ # TODO extract thumbnail from http://www.nhk-ep.co.jp/netstar/kanetomo_contents.html diff --git a/root/plugins/Filter-FindEnclosures/nicovideo.pl b/root/plugins/nicovideo.jp/find_enclosures.pl similarity index 96% rename from root/plugins/Filter-FindEnclosures/nicovideo.pl rename to root/plugins/nicovideo.jp/find_enclosures.pl index b80ea2e2..01f57600 100644 --- a/root/plugins/Filter-FindEnclosures/nicovideo.pl +++ b/root/plugins/nicovideo.jp/find_enclosures.pl @@ -1,7 +1,6 @@ # author: Tatsuhiko Miyagawa sub init { my $self = shift; - $self->{domain} = "nicovideo.jp"; $self->{handle} = "/watch/"; } diff --git a/root/plugins/CustomFeed-FindLinks/nicovideo.yaml b/root/plugins/nicovideo.jp/find_links.yaml similarity index 75% rename from root/plugins/CustomFeed-FindLinks/nicovideo.yaml rename to root/plugins/nicovideo.jp/find_links.yaml index ffa84ab3..3485d774 100644 --- a/root/plugins/CustomFeed-FindLinks/nicovideo.yaml +++ b/root/plugins/nicovideo.jp/find_links.yaml @@ -1,4 +1,3 @@ author: Tatsuhiko Miyagawa -domain: nicovideo.jp follow_link: /watch/(\d+|\w{2}\d+) diff --git a/root/plugins/Filter-FindEnclosures/sc_smm_jst.pl b/root/plugins/sc-smn.jst.go.jp/find_enclosures.pl similarity index 93% rename from root/plugins/Filter-FindEnclosures/sc_smm_jst.pl rename to root/plugins/sc-smn.jst.go.jp/find_enclosures.pl index 86a70845..706a639f 100644 --- a/root/plugins/Filter-FindEnclosures/sc_smm_jst.pl +++ b/root/plugins/sc-smn.jst.go.jp/find_enclosures.pl @@ -3,7 +3,6 @@ use Web::Scraper; sub init { my $self = shift; - $self->{domain} = "sc-smn.jst.go.jp"; $self->{handle} = "/bangumi.asp"; } diff --git a/root/plugins/CustomFeed-FindLinks/sc_smm_jst.yaml b/root/plugins/sc-smn.jst.go.jp/find_links.yaml similarity index 83% rename from root/plugins/CustomFeed-FindLinks/sc_smm_jst.yaml rename to root/plugins/sc-smn.jst.go.jp/find_links.yaml index bcf3163b..beae3f87 100644 --- a/root/plugins/CustomFeed-FindLinks/sc_smm_jst.yaml +++ b/root/plugins/sc-smn.jst.go.jp/find_links.yaml @@ -1,5 +1,4 @@ # upgrades http://sc-smn.jst.go.jp/index.asp # author: otsune -domain: sc-smn.jst.go.jp handle: (?:/\d)?/(?:series|index)\.asp follow_link: /\d/bangumi\.asp diff --git a/root/plugins/CustomFeed-FindLinks/pandoratv.yaml b/root/plugins/search.pandora.tv/find_links.yaml similarity index 71% rename from root/plugins/CustomFeed-FindLinks/pandoratv.yaml rename to root/plugins/search.pandora.tv/find_links.yaml index c6d3b63e..6fe51f68 100644 --- a/root/plugins/CustomFeed-FindLinks/pandoratv.yaml +++ b/root/plugins/search.pandora.tv/find_links.yaml @@ -1,4 +1,3 @@ author: Tatsuhiko Miyagawa -domain: search.pandora.tv handle: . follow_selector: .search_t>a diff --git a/root/plugins/Filter-FindEnclosures/sling.pl b/root/plugins/sling.com/find_enclosures.pl similarity index 94% rename from root/plugins/Filter-FindEnclosures/sling.pl rename to root/plugins/sling.com/find_enclosures.pl index 8e652e93..7f45d3e6 100644 --- a/root/plugins/Filter-FindEnclosures/sling.pl +++ b/root/plugins/sling.com/find_enclosures.pl @@ -2,7 +2,6 @@ sub init { my $self = shift; - $self->{domain} = "sling.com"; $self->{handle} = "/video/show/.*"; } diff --git a/root/plugins/Filter-FindEnclosures/thedailyshow.pl b/root/plugins/thedailyshow.com/find_enclosures.pl similarity index 92% rename from root/plugins/Filter-FindEnclosures/thedailyshow.pl rename to root/plugins/thedailyshow.com/find_enclosures.pl index 2bc19cad..da6361e5 100644 --- a/root/plugins/Filter-FindEnclosures/thedailyshow.pl +++ b/root/plugins/thedailyshow.com/find_enclosures.pl @@ -1,7 +1,6 @@ # author: Tatsuhiko Miyagawa sub init { my $self = shift; - $self->{domain} = "thedailyshow.com"; $self->{handle} = 'video/index\.jhtml\?videoId='; } diff --git a/root/plugins/Filter-FindEnclosures/ann_news.pl b/root/plugins/tv-asahi.co.jp/find_enclosures.pl similarity index 93% rename from root/plugins/Filter-FindEnclosures/ann_news.pl rename to root/plugins/tv-asahi.co.jp/find_enclosures.pl index a6b2513d..9ea71928 100644 --- a/root/plugins/Filter-FindEnclosures/ann_news.pl +++ b/root/plugins/tv-asahi.co.jp/find_enclosures.pl @@ -2,7 +2,6 @@ use Web::Scraper; sub init { my $self = shift; - $self->{domain} = "www.tv-asahi.co.jp"; $self->{handle} = "/ann/news/"; } diff --git a/root/plugins/Filter-FindEnclosures/tvtokyo.pl b/root/plugins/tv-tokyo.co.jp/find_enclosures.pl similarity index 91% rename from root/plugins/Filter-FindEnclosures/tvtokyo.pl rename to root/plugins/tv-tokyo.co.jp/find_enclosures.pl index ae0f96b3..328d7d28 100644 --- a/root/plugins/Filter-FindEnclosures/tvtokyo.pl +++ b/root/plugins/tv-tokyo.co.jp/find_enclosures.pl @@ -1,7 +1,6 @@ # author: Tatsuhiko Miyagawa sub init { my $self = shift; - $self->{domain} = "www.tv-tokyo.co.jp"; $self->{handle} = '/(nms|emorning|newsfine|wbs)/\d+'; } diff --git a/root/plugins/CustomFeed-FindLinks/tvtokyo.yaml b/root/plugins/tv-tokyo.co.jp/find_links.yaml similarity index 79% rename from root/plugins/CustomFeed-FindLinks/tvtokyo.yaml rename to root/plugins/tv-tokyo.co.jp/find_links.yaml index 86aef579..f8eb7348 100644 --- a/root/plugins/CustomFeed-FindLinks/tvtokyo.yaml +++ b/root/plugins/tv-tokyo.co.jp/find_links.yaml @@ -1,4 +1,3 @@ # upgrades http://www.tv-tokyo.co.jp/wbs/ etc -domain: www.tv-tokyo.co.jp handle: . follow_link: /(nms|emorning|newsfine|wbs)/\d+ diff --git a/root/plugins/Filter-FindEnclosures/ugomemo.pl b/root/plugins/ugomemo.hatena.ne.jp/find_enclosures.pl similarity index 93% rename from root/plugins/Filter-FindEnclosures/ugomemo.pl rename to root/plugins/ugomemo.hatena.ne.jp/find_enclosures.pl index edea1c90..f0df0cff 100644 --- a/root/plugins/Filter-FindEnclosures/ugomemo.pl +++ b/root/plugins/ugomemo.hatena.ne.jp/find_enclosures.pl @@ -2,7 +2,6 @@ # feed: http://ugomemo.hatena.ne.jp/rss sub init { my $self = shift; - $self->{domain} = "ugomemo.hatena.ne.jp"; $self->{handle} = "/movie/"; } diff --git a/root/plugins/Filter-FindEnclosures/veoh.pl b/root/plugins/veoh.com/find_enclosures.pl similarity index 95% rename from root/plugins/Filter-FindEnclosures/veoh.pl rename to root/plugins/veoh.com/find_enclosures.pl index 75100c1e..f5cf51dc 100644 --- a/root/plugins/Filter-FindEnclosures/veoh.pl +++ b/root/plugins/veoh.com/find_enclosures.pl @@ -2,7 +2,6 @@ # TODO veoh rss feed has .mp4 file enclosures but it doesn't work with Flash player sub init { my $self = shift; - $self->{domain} = "veoh.com"; $self->{handle} = "videoDetails\.html|/videos/"; } diff --git a/root/plugins/Filter-FindEnclosures/viddler.pl b/root/plugins/viddler.com/find_enclosures.pl similarity index 96% rename from root/plugins/Filter-FindEnclosures/viddler.pl rename to root/plugins/viddler.com/find_enclosures.pl index c75d12bf..89a2c8f2 100644 --- a/root/plugins/Filter-FindEnclosures/viddler.pl +++ b/root/plugins/viddler.com/find_enclosures.pl @@ -1,7 +1,6 @@ # author: Tatsuhiko Miyagawa sub init { my $self = shift; - $self->{domain} = "viddler.com"; $self->{handle} = '/explore/.*videos/\d+/$'; } diff --git a/root/plugins/CustomFeed-FindLinks/viddler.yaml b/root/plugins/viddler.com/find_links.yaml similarity index 78% rename from root/plugins/CustomFeed-FindLinks/viddler.yaml rename to root/plugins/viddler.com/find_links.yaml index 5eec9065..9e5df1bc 100644 --- a/root/plugins/CustomFeed-FindLinks/viddler.yaml +++ b/root/plugins/viddler.com/find_links.yaml @@ -1,5 +1,4 @@ author: Tatsuhiko Miyagawa -domain: viddler.com handle: / follow_link: explore/.*videos/\d+ diff --git a/root/plugins/Filter-FindEnclosures/impresswatch.pl b/root/plugins/video.watch.impress.co.jp/find_enclosures.pl similarity index 71% rename from root/plugins/Filter-FindEnclosures/impresswatch.pl rename to root/plugins/video.watch.impress.co.jp/find_enclosures.pl index 05f525a6..96f4f79b 100644 --- a/root/plugins/Filter-FindEnclosures/impresswatch.pl +++ b/root/plugins/video.watch.impress.co.jp/find_enclosures.pl @@ -1,7 +1,6 @@ # author: Tatsuhiko Miyagawa sub init { my $self = shift; - $self->{domain} = "video.watch.impress.co.jp"; $self->{handle} = "(flash|wmv)\.htm"; } diff --git a/root/plugins/video.watch.impress.co.jp/find_links.yaml b/root/plugins/video.watch.impress.co.jp/find_links.yaml new file mode 100644 index 00000000..36d0240c --- /dev/null +++ b/root/plugins/video.watch.impress.co.jp/find_links.yaml @@ -0,0 +1,2 @@ +handle: . +follow_link: flash.htm diff --git a/root/plugins/Filter-FindEnclosures/vimeo.pl b/root/plugins/vimeo.com/find_enclosures.pl similarity index 96% rename from root/plugins/Filter-FindEnclosures/vimeo.pl rename to root/plugins/vimeo.com/find_enclosures.pl index fdc7fa5b..d2d30b9b 100644 --- a/root/plugins/Filter-FindEnclosures/vimeo.pl +++ b/root/plugins/vimeo.com/find_enclosures.pl @@ -4,7 +4,6 @@ sub init { my $self = shift; - $self->{domain} = "vimeo.com"; $self->{handle} = "."; } diff --git a/root/plugins/CustomFeed-FindLinks/vimeo.yaml b/root/plugins/vimeo.com/find_links.yaml similarity index 80% rename from root/plugins/CustomFeed-FindLinks/vimeo.yaml rename to root/plugins/vimeo.com/find_links.yaml index 357e5467..944cdefe 100644 --- a/root/plugins/CustomFeed-FindLinks/vimeo.yaml +++ b/root/plugins/vimeo.com/find_links.yaml @@ -1,4 +1,3 @@ author: Tatsuhiko Miyagawa -domain: vimeo.com follow_selector: .title>a # support thumbnail! diff --git a/root/plugins/Filter-FindEnclosures/vreel.pl b/root/plugins/vreel.net/find_enclosures.pl similarity index 95% rename from root/plugins/Filter-FindEnclosures/vreel.pl rename to root/plugins/vreel.net/find_enclosures.pl index ae604f2e..3edb08c9 100644 --- a/root/plugins/Filter-FindEnclosures/vreel.pl +++ b/root/plugins/vreel.net/find_enclosures.pl @@ -4,7 +4,6 @@ sub init { my $self = shift; - $self->{domain} = "vreel.net"; $self->{handle} = "watch"; } diff --git a/root/plugins/CustomFeed-FindLinks/vreel.yaml b/root/plugins/vreel.net/find_links.yaml similarity index 72% rename from root/plugins/CustomFeed-FindLinks/vreel.yaml rename to root/plugins/vreel.net/find_links.yaml index ae4139fa..55b80988 100644 --- a/root/plugins/CustomFeed-FindLinks/vreel.yaml +++ b/root/plugins/vreel.net/find_links.yaml @@ -1,4 +1,3 @@ -domain: vreel.net handle: index.php follow_link: watch_\d+\.html diff --git a/root/plugins/Filter-FindEnclosures/woopie.pl b/root/plugins/woopie.jp/find_enclosures.pl similarity index 96% rename from root/plugins/Filter-FindEnclosures/woopie.pl rename to root/plugins/woopie.jp/find_enclosures.pl index 381923c0..c2704c70 100644 --- a/root/plugins/Filter-FindEnclosures/woopie.pl +++ b/root/plugins/woopie.jp/find_enclosures.pl @@ -1,7 +1,6 @@ # author: Tatsuhiko Miyagawa sub init { my $self = shift; - $self->{domain} = "woopie.jp"; $self->{handle} = 'channel/watch/\d+'; } diff --git a/root/plugins/Filter-FindEnclosures/nhk_news.pl b/root/plugins/www3.nhk.or.jp/find_enclosures.pl similarity index 96% rename from root/plugins/Filter-FindEnclosures/nhk_news.pl rename to root/plugins/www3.nhk.or.jp/find_enclosures.pl index bba4270d..aea9be13 100644 --- a/root/plugins/Filter-FindEnclosures/nhk_news.pl +++ b/root/plugins/www3.nhk.or.jp/find_enclosures.pl @@ -1,7 +1,6 @@ # author: Tatsuhiko Miyagawa sub init { my $self = shift; - $self->{domain} = 'www3.nhk.or.jp'; $self->{handle} = '/news/[kt]\d+.html'; } diff --git a/root/plugins/Filter-FindEnclosures/youtube.pl b/root/plugins/youtube.com/find_enclosures.pl similarity index 98% rename from root/plugins/Filter-FindEnclosures/youtube.pl rename to root/plugins/youtube.com/find_enclosures.pl index 4a8bb928..83161ab2 100644 --- a/root/plugins/Filter-FindEnclosures/youtube.pl +++ b/root/plugins/youtube.com/find_enclosures.pl @@ -4,7 +4,6 @@ sub init { my $self = shift; - $self->{domain} = "youtube.com"; $self->{handle} = "."; } diff --git a/root/plugins/CustomFeed-FindLinks/youtube.yaml b/root/plugins/youtube.com/find_links.yaml similarity index 62% rename from root/plugins/CustomFeed-FindLinks/youtube.yaml rename to root/plugins/youtube.com/find_links.yaml index 70750559..b8c52ca5 100644 --- a/root/plugins/CustomFeed-FindLinks/youtube.yaml +++ b/root/plugins/youtube.com/find_links.yaml @@ -1,3 +1,2 @@ -domain: youtube.com handle: . follow_link: /watch\?v= diff --git a/root/plugins/Filter-FindEnclosures/zoome.pl b/root/plugins/zoome.jp/find_enclosures.pl similarity index 95% rename from root/plugins/Filter-FindEnclosures/zoome.pl rename to root/plugins/zoome.jp/find_enclosures.pl index 57354745..aeece0f5 100644 --- a/root/plugins/Filter-FindEnclosures/zoome.pl +++ b/root/plugins/zoome.jp/find_enclosures.pl @@ -2,7 +2,6 @@ use Web::Scraper; sub init { my $self = shift; - $self->{domain} = "zoome.jp"; $self->{handle} = "diary"; }