git://git.camperquake.de
/
videosite.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3ed1591
)
Youtube: decode UTF8 video titles to the internal perl format
author
Ralf Ertzinger
<ralf@skytale.net>
Sat, 18 Jun 2011 12:55:20 +0000
(14:55 +0200)
committer
Ralf Ertzinger
<ralf@skytale.net>
Sat, 18 Jun 2011 12:55:20 +0000
(14:55 +0200)
videosite/YouTubeGrabber.pm
patch
|
blob
|
history
diff --git
a/videosite/YouTubeGrabber.pm
b/videosite/YouTubeGrabber.pm
index
ebb2f69
..
a70993e
100644
(file)
--- a/
videosite/YouTubeGrabber.pm
+++ b/
videosite/YouTubeGrabber.pm
@@
-146,6
+146,7
@@
sub _parse_by_video_info {
$metadata->{'TITLE'} = $content->{'title'};
$metadata->{'TITLE'} =~ s/\+/ /g;
$metadata->{'TITLE'} =~ s/%(..)/chr(hex($1))/ge;
$metadata->{'TITLE'} = $content->{'title'};
$metadata->{'TITLE'} =~ s/\+/ /g;
$metadata->{'TITLE'} =~ s/%(..)/chr(hex($1))/ge;
+ $metadata->{'TITLE'} = decode("utf8", $metadata->{'TITLE'});
$self->debug('Title found: %s', $metadata->{'TITLE'});
$self->debug('Title found: %s', $metadata->{'TITLE'});
@@
-211,9
+212,8
@@
sub _parse_by_scrape {
if (exists($tag->[1]->{'name'}) and ('title' eq $tag->[1]->{'name'})) {
$metadata->{'TITLE'} = $tag->[1]->{'content'};
# Convert HTML entities in the title. This is a bit convoluted.
if (exists($tag->[1]->{'name'}) and ('title' eq $tag->[1]->{'name'})) {
$metadata->{'TITLE'} = $tag->[1]->{'content'};
# Convert HTML entities in the title. This is a bit convoluted.
- $metadata->{'TITLE'} = encode("utf8",
- decode_entities(
- decode("utf8", $metadata->{'TITLE'})));
+ $metadata->{'TITLE'} = decode_entities(
+ decode("utf8", $metadata->{'TITLE'}));
$self->debug('Title found: %s', $metadata->{'TITLE'});
}
$self->debug('Title found: %s', $metadata->{'TITLE'});
}