mirror of
https://github.com/mirror/jdownloader.git
synced 2024-11-23 03:59:51 +00:00
*Plugins: Fixes/Changes/Maintenance*
- BunkrAlbum: added domain bunkrpk RE forum 90262 - ArchiveOrgCrawler: crawlArchiveContentV2: fixed regression and improved errorhandling RE forum 96496 git-svn-id: svn://svn.jdownloader.org/jdownloader/trunk@49853 ebf7c1c2-ba36-0410-9fe8-c592906822b4 Former-commit-id: 9a1c1ff0bdb85c3135ba85cfad28b30ab2da60f2
This commit is contained in:
parent
24d6b9fc20
commit
e0f6541eb3
@ -478,6 +478,12 @@ public class ArchiveOrgCrawler extends PluginForDecrypt {
|
||||
contenturl = URLHelper.getUrlWithoutParams(contenturl) + "?" + query.toString();
|
||||
}
|
||||
}
|
||||
ensureInitHosterplugin();
|
||||
final Account account = AccountController.getInstance().getValidAccount(hostPlugin.getHost());
|
||||
if (account != null) {
|
||||
/* Login if possible as this can have an influence on the books' 'lending-status'. */
|
||||
hostPlugin.login(account, false);
|
||||
}
|
||||
final ArrayList<DownloadLink> ret = new ArrayList<DownloadLink>();
|
||||
try {
|
||||
URLConnectionAdapter con = null;
|
||||
@ -506,7 +512,11 @@ public class ArchiveOrgCrawler extends PluginForDecrypt {
|
||||
} catch (final Throwable e) {
|
||||
}
|
||||
}
|
||||
if (br.getHttpConnection().getResponseCode() == 404) {
|
||||
if (ArchiveOrg.isAccountRequired(br) || ArchiveOrg.isItemUnavailable(br)) {
|
||||
throw new AccountRequiredException();
|
||||
} else if (br.getHttpConnection().getResponseCode() == 403) {
|
||||
throw new AccountRequiredException();
|
||||
} else if (br.getHttpConnection().getResponseCode() == 404) {
|
||||
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
|
||||
} else if (!isCompressedArchiveURL(br.getURL())) {
|
||||
/* Redirect to some unsupported URL. */
|
||||
@ -1717,8 +1727,7 @@ public class ArchiveOrgCrawler extends PluginForDecrypt {
|
||||
/* This link will go back into this crawler to find all individual downloadlinks. */
|
||||
ret.add(createDownloadlink(downloadurl));
|
||||
return ret;
|
||||
} else if (br.containsHTML("(?i)>\\s*You must log in to view this content") || br.containsHTML("(?i)>\\s*Item not available|>\\s*The item is not available due to issues with the item's content")) {
|
||||
/* 2021-02-24: <p class="theatre-title">You must log in to view this content</p> */
|
||||
} else if (ArchiveOrg.isItemUnavailable(br) || ArchiveOrg.isAccountRequired(br)) {
|
||||
if (br.containsHTML("/download/" + Pattern.quote(identifier))) {
|
||||
/* Account is still required but we can go ahead and crawl all individual file URLs via XML. */
|
||||
ret.add(createDownloadlink(downloadurl));
|
||||
|
@ -65,7 +65,7 @@ public class BunkrAlbum extends PluginForDecrypt {
|
||||
public static List<String[]> getPluginDomains() {
|
||||
final List<String[]> ret = new ArrayList<String[]>();
|
||||
// each entry in List<String[]> will result in one PluginForDecrypt, Plugin.getHost() will return String[0]->main domain
|
||||
ret.add(new String[] { MAIN_BUNKR_DOMAIN, "bunkr.su", "bunkr.si", "bunkr.ru", "bunkr.is", "bunkr.la", "bunkrr.ru", "bunkr.sk", "bunkr.black", "bunkr.cat", "bunkr.media", "bunkr.ac", "bunkr.ws", "bunkr.red", "bunkr.site", "bunkr.black", "bunkrrr.org", "bunkr.fi", "bunkr.ci", "bunkr.ax", "bunkr.ac", "bunkr.se", "bunkr.es" });
|
||||
ret.add(new String[] { MAIN_BUNKR_DOMAIN, "bunkr.su", "bunkr.si", "bunkr.ru", "bunkr.is", "bunkr.la", "bunkrr.ru", "bunkr.sk", "bunkr.black", "bunkr.cat", "bunkr.media", "bunkr.ac", "bunkr.ws", "bunkr.red", "bunkr.site", "bunkr.black", "bunkrrr.org", "bunkr.fi", "bunkr.ci", "bunkr.ax", "bunkr.ac", "bunkr.se", "bunkr.es", "bunkr.pk" });
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -383,9 +383,8 @@ public class ArchiveOrg extends PluginForHost {
|
||||
} else if (con.getResponseCode() == 404) {
|
||||
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
|
||||
}
|
||||
/* <h1>Item not available</h1> */
|
||||
if (br.containsHTML("(?i)>\\s*Item not available<")) {
|
||||
if (br.containsHTML("(?i)>\\s*The item is not available due to issues")) {
|
||||
if (ArchiveOrg.isItemUnavailable(br)) {
|
||||
if (ArchiveOrg.isAccountRequired(br)) {
|
||||
/* First check for this flag */
|
||||
if (link.hasProperty(PROPERTY_IS_NOT_DOWNLOADABLE)) {
|
||||
throw new PluginException(LinkStatus.ERROR_FATAL, ERRORMSG_FILE_NOT_DOWNLOADABLE);
|
||||
@ -433,6 +432,22 @@ public class ArchiveOrg extends PluginForHost {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isItemUnavailable(final Browser br) {
|
||||
if (br.containsHTML(">\\s*Item not available")) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isAccountRequired(final Browser br) {
|
||||
if (br.containsHTML(">\\s*You must log in to view this content|>\\s*The item is not available due to issues")) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleFree(final DownloadLink link) throws Exception, PluginException {
|
||||
handleDownload(null, link);
|
||||
|
Loading…
Reference in New Issue
Block a user