Skip to content

Commit

Permalink
Tweaks to vinebox ripper
Browse files Browse the repository at this point in the history
  • Loading branch information
4pr0n committed Mar 8, 2014
1 parent 8bfae56 commit 2e1ee0f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,7 @@ public boolean canRip(URL url) {

@Override
public URL sanitizeURL(URL url) throws MalformedURLException {
Pattern p = Pattern.compile("^https?://(www\\.)?vinebox\\.co/u/([a-zA-Z0-9]{1,}).*$");
Matcher m = p.matcher(url.toExternalForm());
if (!m.matches()) {
throw new MalformedURLException("Expected format: http://vinebox.co/u/USERNAME");
}
return new URL("http://vinebox.co/u/" + m.group(m.groupCount()));
return new URL("http://vinebox.co/u/" + getGID(url));
}

@Override
Expand Down Expand Up @@ -74,7 +69,6 @@ public String getHost() {
@Override
public String getGID(URL url) throws MalformedURLException {
Pattern p = Pattern.compile("^https?://(www\\.)?vinebox\\.co/u/([a-zA-Z0-9]{1,}).*$");
System.err.println(url);
Matcher m = p.matcher(url.toExternalForm());
if (!m.matches()) {
throw new MalformedURLException("Expected format: http://vinebox.co/u/USERNAME");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
public class VineboxRipperTest extends RippersTest {

public void testVineboxAlbums() throws IOException {
if (false && !DOWNLOAD_CONTENT) {
if (DOWNLOAD_CONTENT) {
return;
}
List<URL> contentURLs = new ArrayList<URL>();
contentURLs.add(new URL("http://vinebox.co/u/wiZS1MvkgEo"));
contentURLs.add(new URL("http://vinebox.co/u/wi57hMjc2Ka"));
for (URL url : contentURLs) {
try {
VineboxRipper ripper = new VineboxRipper(url);
Expand Down

0 comments on commit 2e1ee0f

Please sign in to comment.