Reverted Danbooru image policy change and added EEPROM uploading for Gelbooru and Konachan.
Wanted to do this for Yandere as well, but the images are Fucking Massive and cause timeouts 9 out of 10 times.
This commit is contained in:
parent
293e3c5b81
commit
de08e4e4cc
4 changed files with 7 additions and 7 deletions
|
@ -4,8 +4,6 @@ namespace Satori\Booru\Danbooru;
|
|||
use Satori\Booru\IBooruPostWithSpecificTags;
|
||||
|
||||
class DanbooruPost implements IBooruPostWithSpecificTags {
|
||||
private const ALLOW_FILE_URL_RATING = ['g', 's'];
|
||||
|
||||
public function __construct(private array $info) {}
|
||||
|
||||
public function getId(): string {
|
||||
|
@ -25,7 +23,7 @@ class DanbooruPost implements IBooruPostWithSpecificTags {
|
|||
}
|
||||
|
||||
public function hasFileUrl(): bool {
|
||||
return array_key_exists('file_url', $this->info) && in_array($this->info['rating'], self::ALLOW_FILE_URL_RATING);
|
||||
return array_key_exists('file_url', $this->info);
|
||||
}
|
||||
|
||||
public function getFileUrl(): string {
|
||||
|
|
|
@ -23,7 +23,7 @@ class GelbooruPost implements IBooruPost {
|
|||
}
|
||||
|
||||
public function hasFileUrl(): bool {
|
||||
return false; // remote embedding is blocked
|
||||
return array_key_exists('file_url', $this->info);
|
||||
}
|
||||
|
||||
public function getFileUrl(): string {
|
||||
|
|
|
@ -28,7 +28,7 @@ class KonachanPost implements IBooruPost {
|
|||
}
|
||||
|
||||
public function hasFileUrl(): bool {
|
||||
return false; // remote embedding is blocked
|
||||
return array_key_exists('file_url', $this->info);
|
||||
}
|
||||
|
||||
public function getFileUrl(): string {
|
||||
|
|
|
@ -23,10 +23,12 @@ class YanderePost implements IBooruPost {
|
|||
}
|
||||
|
||||
public function hasFileUrl(): bool {
|
||||
return false; // remote embedding is blocked
|
||||
// yandere images get fucking massive sometimes
|
||||
// and make the upload process timeout and silently fail
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getFileUrl(): string {
|
||||
return $this->info['file_url'];
|
||||
return $this->info['sample_url'];
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue