Changeset 1862
- Timestamp:
- 11/26/06 17:01:45
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/plagger/lib/Plagger/Plugin/Filter/DegradeYouTube.pm
r1861 r1862 6 6 7 7 my $regex = <<'...'; 8 <object width="\d+" height="\d+" ><param name="movie" value="(http://www.youtube.com/[^"]+)"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/[^"]+" type="application/x-shockwave-flash" wmode="transparent" width="\d+" height="\d+"></embed></object>8 <object width="\d+" height="\d+".*?><param name="movie" value="(http://www.youtube.com/[^"]+)".*?><param name="wmode" value="transparent".*?>(.*?)</object> 9 9 ... 10 10 chomp $regex; … … 28 28 my $body; 29 29 if (my $dev_id = $self->conf->{dev_id}) { 30 my $thumb_url = $self->_thumbnail_url($dev_id, $self->_video_id($url)); 30 my $thumb_url = $self->cache->get_callback( 31 $url, 32 sub { $self->_thumbnail_url($dev_id, $self->_video_id($url)) }, 33 60 * 60 * 24, 34 ); 35 $context->log(info => "Thumbnail for $url => $thumb_url"); 31 36 qq{<a href="$url"><img src="$thumb_url" /></a>} 32 37 } else {
