[nebula] Use PATCHRequest instead of Request

Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
This commit is contained in:
Geoffrey Frogeye
2025-05-07 10:18:44 +02:00
committed by GitHub
co-authored by bashonly
parent c091eb8e0c
commit 7b264c19ef
+5 -8
View File
@@ -3,7 +3,7 @@ import json
from .art19 import Art19IE from .art19 import Art19IE
from .common import InfoExtractor from .common import InfoExtractor
from ..networking.common import Request from ..networking import PATCHRequest
from ..networking.exceptions import HTTPError from ..networking.exceptions import HTTPError
from ..utils import ( from ..utils import (
ExtractorError, ExtractorError,
@@ -113,14 +113,11 @@ class NebulaBaseIE(InfoExtractor):
} }
def _mark_watched(self, content_id, slug): def _mark_watched(self, content_id, slug):
data = {'completed': True}
req = Request(
f'https://content.api.nebula.app/{content_id.split(":")[0]}s/{content_id}/progress/',
method='PATCH')
self._call_api( self._call_api(
req, slug, PATCHRequest(f'https://content.api.nebula.app/{content_id.split(":")[0]}s/{content_id}/progress/'),
data=json.dumps(data).encode('utf8'), headers={'content-type': 'application/json'}, slug, 'Marking watched', 'Unable to mark watched', fatal=False,
fatal=False, note='Marking watched', errnote='Unable to mark watched') data=json.dumps({'completed': True}).encode(),
headers={'content-type': 'application/json'})
class NebulaIE(NebulaBaseIE): class NebulaIE(NebulaBaseIE):