Explorar el Código

Parse durations for longer videos

Zachary Kotlarek hace 11 años
padre
commit
c8bb503904
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      yt/subscribe.pl

+ 3 - 1
yt/subscribe.pl

@@ -1013,7 +1013,9 @@ sub calcVideoData($) {
 	} else {
 		$video->{'season'} = 0;
 	}
-	if ($video->{'rawDuration'} =~ /PT(\d+)M(\d+)S/) {
+	if ($video->{'rawDuration'} =~ /PT(\d+)H(\d+)M(\d+)S/) {
+		$video->{'duration'} = ($1 * 3600) + ($2 * 60) + $2;
+	} elsif ($video->{'rawDuration'} =~ /PT(\d+)M(\d+)S/) {
 		$video->{'duration'} = ($1 * 60) + $2;
 	} elsif ($video->{'rawDuration'} =~ /PT(\d+)S/) {
 		$video->{'duration'} = $1;