Code improvements
This commit is contained in:
parent
ea120a4637
commit
adde4332d1
|
@ -119,16 +119,16 @@ public class BandcampExtractorHelper {
|
||||||
/**
|
/**
|
||||||
* @param id The image ID
|
* @param id The image ID
|
||||||
* @param album Whether this is the cover of an album
|
* @param album Whether this is the cover of an album
|
||||||
* @return Url of image with this ID in size 10 which is 1200x1200 (we could also choose size 0
|
* @return URL of image with this ID in size 10 which is 1200x1200 (we could also choose size 0
|
||||||
* but we don't want something as large as 3460x3460 here, do we?)
|
* but we don't want something as large as 3460x3460 here)
|
||||||
*/
|
*/
|
||||||
public static String getImageUrl(final long id, final boolean album) {
|
public static String getImageUrl(final long id, final boolean album) {
|
||||||
return "https://f4.bcbits.com/img/" + (album ? 'a' : "") + id + "_10.jpg";
|
return "https://f4.bcbits.com/img/" + (album ? 'a' : "") + id + "_10.jpg";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return <code>true</code> if the given url looks like it comes from a bandcamp custom domain
|
* @return <code>true</code> if the given URL looks like it comes from a bandcamp custom domain
|
||||||
* or if it comes from bandcamp.com itself
|
* or if it comes from <code>bandcamp.com</code> itself
|
||||||
*/
|
*/
|
||||||
public static boolean isSupportedDomain(final String url) throws ParsingException {
|
public static boolean isSupportedDomain(final String url) throws ParsingException {
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ public class BandcampExtractorHelper {
|
||||||
/**
|
/**
|
||||||
* Whether the URL points to a radio kiosk.
|
* Whether the URL points to a radio kiosk.
|
||||||
* @param url the URL to check
|
* @param url the URL to check
|
||||||
* @return true if the URL is <code>https://bandcamp.com/?show=SHOW_ID</code>
|
* @return true if the URL matches <code>https://bandcamp.com/?show=SHOW_ID</code>
|
||||||
*/
|
*/
|
||||||
public static boolean isRadioUrl(final String url) {
|
public static boolean isRadioUrl(final String url) {
|
||||||
return url.toLowerCase().matches("https?://bandcamp\\.com/\\?show=\\d+");
|
return url.toLowerCase().matches("https?://bandcamp\\.com/\\?show=\\d+");
|
||||||
|
|
|
@ -18,11 +18,6 @@ public class BandcampDiscographStreamInfoItemExtractor extends BandcampStreamInf
|
||||||
return discograph.getString("band_name");
|
return discograph.getString("band_name");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isUploaderVerified() throws ParsingException {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return discograph.getString("title");
|
return discograph.getString("title");
|
||||||
|
|
|
@ -53,11 +53,6 @@ public class BandcampPlaylistStreamInfoItemExtractor extends BandcampStreamInfoI
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isUploaderVerified() throws ParsingException {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Each track can have its own cover art. Therefore, unless a substitute is provided,
|
* Each track can have its own cover art. Therefore, unless a substitute is provided,
|
||||||
* the thumbnail is extracted using a stream extractor.
|
* the thumbnail is extracted using a stream extractor.
|
||||||
|
|
|
@ -24,11 +24,6 @@ public class BandcampSearchStreamInfoItemExtractor extends BandcampStreamInfoIte
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isUploaderVerified() throws ParsingException {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() throws ParsingException {
|
public String getName() throws ParsingException {
|
||||||
return resultInfo.getElementsByClass("heading").text();
|
return resultInfo.getElementsByClass("heading").text();
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.schabi.newpipe.extractor.services.bandcamp.extractors.streaminfoitem;
|
package org.schabi.newpipe.extractor.services.bandcamp.extractors.streaminfoitem;
|
||||||
|
|
||||||
|
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||||
import org.schabi.newpipe.extractor.localization.DateWrapper;
|
import org.schabi.newpipe.extractor.localization.DateWrapper;
|
||||||
import org.schabi.newpipe.extractor.stream.StreamInfoItemExtractor;
|
import org.schabi.newpipe.extractor.stream.StreamInfoItemExtractor;
|
||||||
import org.schabi.newpipe.extractor.stream.StreamType;
|
import org.schabi.newpipe.extractor.stream.StreamType;
|
||||||
|
@ -44,9 +45,11 @@ public abstract class BandcampStreamInfoItemExtractor implements StreamInfoItemE
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* There are no ads just like that, duh
|
public boolean isUploaderVerified() throws ParsingException {
|
||||||
*/
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isAd() {
|
public boolean isAd() {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue