- while ($e = $p->get_tag('a')) {
- if ((exists($e->[1]{'id'})) and ('ipoddownloadlink' eq $e->[1]{'id'})) {
- $metadata->{'DLURL'} = $e->[1]{'href'};
- last;
+ if ($quality eq 'h264') {
+ while ($e = $p->get_tag('a')) {
+ if ((exists($e->[1]{'id'})) and ('ipoddownloadlink' eq $e->[1]{'id'})) {
+ $metadata->{'DLURL'} = $e->[1]{'href'};
+ last;
+ }
+ }
+ } else {
+ while ($e = $p->get_tag('script')) {
+ if ($p->get_text() =~ m|googleplayer\.swf\?\\46videoUrl\\75(.+?)\\46|s) {
+ my $u = $1;
+ $u =~ s/%(..)/chr(hex($1))/ge;
+ $metadata->{'DLURL'} = $u;
+ last;
+ }