mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-26 23:34:53 +02:00
Added some more checks to avoid downloading invaild urls
This commit is contained in:
@@ -237,6 +237,12 @@ public abstract class AbstractRipper
|
|||||||
* False if failed to download
|
* False if failed to download
|
||||||
*/
|
*/
|
||||||
protected boolean addURLToDownload(URL url, String prefix, String subdirectory, String referrer, Map<String, String> cookies, String fileName, String extension, Boolean getFileExtFromMIME) {
|
protected boolean addURLToDownload(URL url, String prefix, String subdirectory, String referrer, Map<String, String> cookies, String fileName, String extension, Boolean getFileExtFromMIME) {
|
||||||
|
// A common bug is rippers adding urls that are just "http:". This rejects said urls
|
||||||
|
if (url.toExternalForm().equals("http:") || url.toExternalForm().equals("https:")) {
|
||||||
|
LOGGER.info(url.toExternalForm() + " is a invalid url amd will be changed");
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
// Make sure the url doesn't contain any spaces as that can cause a 400 error when requesting the file
|
// Make sure the url doesn't contain any spaces as that can cause a 400 error when requesting the file
|
||||||
if (url.toExternalForm().contains(" ")) {
|
if (url.toExternalForm().contains(" ")) {
|
||||||
// If for some reason the url with all spaces encoded as %20 is malformed print an error
|
// If for some reason the url with all spaces encoded as %20 is malformed print an error
|
||||||
@@ -425,6 +431,7 @@ public abstract class AbstractRipper
|
|||||||
* Notifies observers and updates state if all files have been ripped.
|
* Notifies observers and updates state if all files have been ripped.
|
||||||
*/
|
*/
|
||||||
void checkIfComplete() {
|
void checkIfComplete() {
|
||||||
|
LOGGER.debug("Checkifcomplete was called");
|
||||||
if (observer == null) {
|
if (observer == null) {
|
||||||
LOGGER.debug("observer is null");
|
LOGGER.debug("observer is null");
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user