[gofile] automatically fetch 'website-token' by default

the hardcoded token changed yet again
pull/4096/head
Mike Fährmann 1 year ago
parent e3fed9bd17
commit 77abcf5ab3
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -1686,15 +1686,14 @@ extractor.gofile.website-token
------------------------------
Type
``string``
Default
``"abcde"``
Description
API token value used during API requests.
A not up-to-date value will result in ``401 Unauthorized`` errors.
An invalid or not up-to-date value
will result in ``401 Unauthorized`` errors.
Setting this value to ``null`` will do an extra HTTP request to fetch
the current value used by gofile.
Keeping this option unset will use an extra HTTP request
to attempt to fetch the current value used by gofile.
extractor.gofile.recursive

@ -129,7 +129,7 @@
},
"gofile": {
"api-token": null,
"website-token": "12345"
"website-token": null
},
"hentaifoundry":
{

@ -6,7 +6,7 @@
from .common import Extractor, Message
from .. import text, exception
from ..cache import memcache
from ..cache import cache, memcache
import hashlib
@ -75,10 +75,8 @@ class GofileFolderExtractor(Extractor):
self.session.cookies.set("accountToken", token, domain=".gofile.io")
self.api_token = token
token = self.config("website-token", "abcde")
if not token:
token = self._get_website_token()
self.website_token = token
self.website_token = (self.config("website-token") or
self._get_website_token())
folder = self._get_content(self.content_id, password)
yield Message.Directory, folder
@ -111,7 +109,7 @@ class GofileFolderExtractor(Extractor):
self.log.debug("Creating temporary account")
return self._api_request("createAccount")["token"]
@memcache()
@cache(maxage=86400)
def _get_website_token(self):
self.log.debug("Fetching website token")
page = self.request(self.root + "/dist/js/alljs.js").text

Loading…
Cancel
Save