]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/chingari.py
[extractor] Deprecate `_sort_formats`
[yt-dlp.git] / yt_dlp / extractor / chingari.py
index e6841fb8b2b3e5499f40e67494e0fd60607111af..48091dd654192820b440d19c504bce7923f65ab6 100644 (file)
@@ -1,14 +1,11 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
 import itertools
 import json
+import urllib.parse
 
 from .common import InfoExtractor
-from ..compat import compat_urllib_parse_unquote_plus
 from ..utils import (
-    clean_html,
     ExtractorError,
+    clean_html,
     int_or_none,
     str_to_int,
     url_or_none,
@@ -35,7 +32,6 @@ def _get_post(self, id, post_data):
                 'url': base_url + '/apipublic' + media_data['path'],
                 'quality': 10,
             })
-        self._sort_formats(formats)
         timestamp = str_to_int(post_data.get('created_at'))
         if timestamp:
             timestamp = int_or_none(timestamp, 1000)
@@ -48,8 +44,10 @@ def _get_post(self, id, post_data):
 
         return {
             'id': id,
-            'title': compat_urllib_parse_unquote_plus(clean_html(post_data.get('caption'))),
-            'description': compat_urllib_parse_unquote_plus(clean_html(post_data.get('caption'))),
+            'extractor_key': ChingariIE.ie_key(),
+            'extractor': 'Chingari',
+            'title': urllib.parse.unquote_plus(clean_html(post_data.get('caption'))),
+            'description': urllib.parse.unquote_plus(clean_html(post_data.get('caption'))),
             'duration': media_data.get('duration'),
             'thumbnail': url_or_none(thumbnail),
             'like_count': post_data.get('likeCount'),
@@ -105,11 +103,11 @@ class ChingariUserIE(ChingariBaseIE):
     _VALID_URL = r'https?://(?:www\.)?chingari\.io/(?!share/post)(?P<id>[^/?]+)'
     _TESTS = [{
         'url': 'https://chingari.io/dada1023',
-        'playlist_mincount': 3,
         'info_dict': {
             'id': 'dada1023',
         },
-        'entries': [{
+        'params': {'playlistend': 3},
+        'playlist': [{
             'url': 'https://chingari.io/share/post?id=614781f3ade60b3a0bfff42a',
             'info_dict': {
                 'id': '614781f3ade60b3a0bfff42a',