Skip to content

Commit

Permalink
Merge branch 'vget-1.0.32'
Browse files Browse the repository at this point in the history
  • Loading branch information
axet committed Dec 6, 2012
2 parents d69aca5 + 72c6722 commit fb7a94a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.github.axet</groupId>
<artifactId>vget</artifactId>
<packaging>jar</packaging>
<version>1.0.31</version>
<version>1.0.32</version>
<name>vget</name>
<description>vget java video download library</description>
<url>https://github.com/axet/vget</url>
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/github/axet/vget/info/VGetParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ void getVideo(VideoInfo vvi, Map<VideoQuality, URL> sNextVideoURL, VideoQuality
}
}

// Rare error:
//
// The live recording you're trying to play is still being processed and will be available soon.
// Sorry, please try again later.
//
// retry. since youtube may already rendrered propertly quality.
throw new DownloadRetry("no video with required quality found");
}
Expand Down
18 changes: 15 additions & 3 deletions src/main/java/com/github/axet/vget/info/YouTubeParser.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.github.axet.vget.info;

import java.io.FileNotFoundException;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
Expand Down Expand Up @@ -52,6 +53,14 @@ public EmbeddingDisabled(String msg) {
}
}

public static class VideoDeleted extends DownloadError {
private static final long serialVersionUID = 1L;

public VideoDeleted(String msg) {
super(msg);
}
}

HashMap<VideoQuality, URL> sNextVideoURL = new HashMap<VideoQuality, URL>();

URL source;
Expand Down Expand Up @@ -218,9 +227,12 @@ public void notifyMoved() {
if (map.get("status").equals("fail")) {
String r = URLDecoder.decode(map.get("reason"), "UTF-8");
if (map.get("errorcode").equals("150"))
throw new PrivateVideoException(r);
else
throw new EmbeddingDisabled(r);
throw new EmbeddingDisabled("error code 150");
if (map.get("errorcode").equals("100"))
throw new VideoDeleted("error code 100");

throw new DownloadError(r);
// throw new PrivateVideoException(r);
}

info.setTitle(URLDecoder.decode(map.get("title"), "UTF-8"));
Expand Down

0 comments on commit fb7a94a

Please sign in to comment.