Skip to content
This repository was archived by the owner on Nov 8, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/invidious/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ def playlist(self, page=1, limit=100, **kwargs):
# feed ---------------------------------------------------------------------

def feed(self, ids, page=1, **kwargs):
if self.__client__.isLoggedIn():
return Videos([y for x in self.__query__("auth/feed", **kwargs).values() for y in x], **kwargs)

data, limit = self.__client__.feed(ids, page=page, **kwargs)
return Videos(data, limit=limit)

Expand Down
11 changes: 11 additions & 0 deletions lib/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,13 @@ def __setup__(self):
self.__url__ = urlunsplit(
(self.__scheme__, self.__netloc__, path, "", "")
)

token = getSetting("token", str)
if token:
self.__headers__["Authorization"] = f"Bearer {token}"
else:
self.__headers__.pop("Authorization", None)

self.logger.info(f"instance: {self.__url__!r}")
self.__session__().__setup__()

Expand Down Expand Up @@ -231,6 +238,10 @@ def __query_feed__(id):
self.__feed__.update(self.__pool__.map(__query_feed__, ids))
return self.__feed__.page(page)

@public
def isLoggedIn(self):
return self.__headers__.__contains__("Authorization")

# video --------------------------------------------------------------------

def fixUrl(self, url, proxy=False):
Expand Down
4 changes: 4 additions & 0 deletions resources/language/resource.language.de_de/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ msgctxt "#30107"
msgid "Instance"
msgstr ""

msgctxt "#30108"
msgid "Authentication token"
msgstr "Authentifizierungs-Token"

msgctxt "#30110"
msgid "Displays a list of public instances, along with the region the server is hosted in. Selecting one will update the \"Instance hostname/ip address\" setting."
msgstr ""
Expand Down
4 changes: 4 additions & 0 deletions resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ msgctxt "#30107"
msgid "Instance"
msgstr ""

msgctxt "#30108"
msgid "Authentication token"
msgstr ""

msgctxt "#30110"
msgid "Displays a list of public instances, along with the region the server is hosted in. Selecting one will update the \"Instance hostname/ip address\" setting."
msgstr ""
Expand Down
4 changes: 4 additions & 0 deletions resources/language/resource.language.es_es/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ msgctxt "#30107"
msgid "Instance"
msgstr ""

msgctxt "#30108"
msgid "Authentication token"
msgstr "Token de autenticación"

msgctxt "#30110"
msgid "Displays a list of public instances, along with the region the server is hosted in. Selecting one will update the \"Instance hostname/ip address\" setting."
msgstr ""
Expand Down
4 changes: 4 additions & 0 deletions resources/language/resource.language.fr_fr/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ msgctxt "#30107"
msgid "Instance"
msgstr "Instance"

msgctxt "#30108"
msgid "Authentication token"
msgstr "Token d'authentification"

msgctxt "#30110"
msgid "Displays a list of public instances, along with the region the server is hosted in. Selecting one will update the \"Instance hostname/ip address\" setting."
msgstr ""
Expand Down
11 changes: 11 additions & 0 deletions resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@
</control>
</setting>

<setting id="token" label="30108" type="string">
<level>0</level>
<default></default>
<constraints>
<allowempty>true</allowempty>
</constraints>
<control type="edit" format="string">
<heading>30108</heading>
</control>
</setting>

<setting id="ssl" label="30104" type="boolean">
<level>0</level>
<default>true</default>
Expand Down