1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-08-07 14:26:36 +02:00

Fix slow tests

Added fast stop to Furaffinity and Xhamster (break in for loops)
This commit is contained in:
Stilgar
2021-05-21 01:08:23 +02:00
parent 3c4e303358
commit 36ea142a19
2 changed files with 9 additions and 0 deletions

View File

@@ -125,6 +125,9 @@ public class FuraffinityRipper extends AbstractHTMLRipper {
urls.add(urlToAdd); urls.add(urlToAdd);
} }
} }
if (isStopped() || isThisATest()) {
break;
}
} }
return urls; return urls;
} }

View File

@@ -84,6 +84,9 @@ public class XhamsterRipper extends AbstractHTMLRipper {
LOGGER.info("getting albums"); LOGGER.info("getting albums");
for (Element elem : doc.select("div.item-container > a.item")) { for (Element elem : doc.select("div.item-container > a.item")) {
urlsToAddToQueue.add(elem.attr("href")); urlsToAddToQueue.add(elem.attr("href"));
if (isStopped() || isThisATest()) {
break;
}
} }
LOGGER.info(doc.html()); LOGGER.info(doc.html());
return urlsToAddToQueue; return urlsToAddToQueue;
@@ -169,6 +172,9 @@ public class XhamsterRipper extends AbstractHTMLRipper {
} catch (IOException e) { } catch (IOException e) {
LOGGER.error("Was unable to load page " + pageWithImageUrl); LOGGER.error("Was unable to load page " + pageWithImageUrl);
} }
if (isStopped() || isThisATest()) {
break;
}
} }
} else { } else {
String imgUrl = doc.select("div.player-container > a").attr("href"); String imgUrl = doc.select("div.player-container > a").attr("href");