Tweaks to vinebox ripper
This commit is contained in:
parent
8bfae563d2
commit
2e1ee0fa6d
@ -31,12 +31,7 @@ public class VineboxRipper extends AbstractRipper {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public URL sanitizeURL(URL url) throws MalformedURLException {
|
public URL sanitizeURL(URL url) throws MalformedURLException {
|
||||||
Pattern p = Pattern.compile("^https?://(www\\.)?vinebox\\.co/u/([a-zA-Z0-9]{1,}).*$");
|
return new URL("http://vinebox.co/u/" + getGID(url));
|
||||||
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()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -74,7 +69,6 @@ public class VineboxRipper extends AbstractRipper {
|
|||||||
@Override
|
@Override
|
||||||
public String getGID(URL url) throws MalformedURLException {
|
public String getGID(URL url) throws MalformedURLException {
|
||||||
Pattern p = Pattern.compile("^https?://(www\\.)?vinebox\\.co/u/([a-zA-Z0-9]{1,}).*$");
|
Pattern p = Pattern.compile("^https?://(www\\.)?vinebox\\.co/u/([a-zA-Z0-9]{1,}).*$");
|
||||||
System.err.println(url);
|
|
||||||
Matcher m = p.matcher(url.toExternalForm());
|
Matcher m = p.matcher(url.toExternalForm());
|
||||||
if (!m.matches()) {
|
if (!m.matches()) {
|
||||||
throw new MalformedURLException("Expected format: http://vinebox.co/u/USERNAME");
|
throw new MalformedURLException("Expected format: http://vinebox.co/u/USERNAME");
|
||||||
|
@ -10,11 +10,11 @@ import com.rarchives.ripme.ripper.rippers.VineboxRipper;
|
|||||||
public class VineboxRipperTest extends RippersTest {
|
public class VineboxRipperTest extends RippersTest {
|
||||||
|
|
||||||
public void testVineboxAlbums() throws IOException {
|
public void testVineboxAlbums() throws IOException {
|
||||||
if (false && !DOWNLOAD_CONTENT) {
|
if (DOWNLOAD_CONTENT) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
List<URL> contentURLs = new ArrayList<URL>();
|
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) {
|
for (URL url : contentURLs) {
|
||||||
try {
|
try {
|
||||||
VineboxRipper ripper = new VineboxRipper(url);
|
VineboxRipper ripper = new VineboxRipper(url);
|
||||||
|
Loading…
Reference in New Issue
Block a user