]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/piapro.py
[cleanup] Add more ruff rules (#10149)
[yt-dlp.git] / yt_dlp / extractor / piapro.py
index 87d912d568d99ed40a6f1a08f0564b90605ed82d..72e3748a20477e8a6d6625bb65d3a86ce63891ca 100644 (file)
@@ -1,5 +1,6 @@
+import urllib.parse
+
 from .common import InfoExtractor
-from ..compat import compat_urlparse
 from ..utils import (
     ExtractorError,
     clean_html,
@@ -30,7 +31,7 @@ class PiaproIE(InfoExtractor):
             'thumbnail': r're:^https?://.*\.(?:png|jpg)$',
             'upload_date': '20090901',
             'view_count': int,
-        }
+        },
     }, {
         'note': 'There are break lines in description, mandating (?s) flag',
         'url': 'https://piapro.jp/t/9cSd',
@@ -47,13 +48,13 @@ class PiaproIE(InfoExtractor):
             'view_count': int,
             'thumbnail': r're:^https?://.*\.(?:png|jpg)$',
             'uploader_id': 'cyankino',
-        }
+        },
     }, {
         'url': 'https://piapro.jp/content/hcw0z3a169wtemz6',
-        'only_matching': True
+        'only_matching': True,
     }, {
         'url': 'https://piapro.jp/t/-SO-',
-        'only_matching': True
+        'only_matching': True,
     }]
 
     _login_status = False
@@ -64,7 +65,7 @@ def _perform_login(self, username, password):
             '_username': username,
             '_password': password,
             '_remember_me': 'on',
-            'login': 'ログイン'
+            'login': 'ログイン',
         }
         self._request_webpage('https://piapro.jp/login/', None)
         urlh = self._request_webpage(
@@ -74,7 +75,7 @@ def _perform_login(self, username, password):
         if urlh is False:
             login_ok = False
         else:
-            parts = compat_urlparse.urlparse(urlh.url)
+            parts = urllib.parse.urlparse(urlh.url)
             if parts.path != '/':
                 login_ok = False
         if not login_ok: