3 from .common
import InfoExtractor
4 from ..utils
import strip_or_none
, traverse_obj
7 class BlerpIE(InfoExtractor
):
9 _VALID_URL
= r
'https?://(?:www\.)?blerp\.com/soundbites/(?P<id>[0-9a-zA-Z]+)'
11 'url': 'https://blerp.com/soundbites/6320fe8745636cb4dd677a5a',
13 'id': '6320fe8745636cb4dd677a5a',
14 'title': 'Samsung Galaxy S8 Over the Horizon Ringtone 2016',
15 'uploader': 'luminousaj',
16 'uploader_id': '5fb81e51aa66ae000c395478',
18 'tags': ['samsung', 'galaxy', 's8', 'over the horizon', '2016', 'ringtone'],
21 'url': 'https://blerp.com/soundbites/5bc94ef4796001000498429f',
23 'id': '5bc94ef4796001000498429f',
25 'uploader': '179617322678353920',
26 'uploader_id': '5ba99cf71386730004552c42',
28 'tags': ['YEE', 'YEET', 'wo ha haah catchy tune yee', 'yee'],
32 _GRAPHQL_OPERATIONNAME
= 'webBitePageGetBite'
34 '''query webBitePageGetBite($_id: MongoID!) {
44 fragment bitePageFrag on Bite {
79 totalAddedToBoardCount
112 reportedContentStatus
137 def _real_extract(self
, url
):
138 audio_id
= self
._match
_id
(url
)
141 'operationName': self
._GRAPHQL
_OPERATIONNAME
,
142 'query': self
._GRAPHQL
_QUERY
,
149 'Content-Type': 'application/json',
152 json_result
= self
._download
_json
(
153 'https://api.blerp.com/graphql', audio_id
,
154 data
=json
.dumps(data
).encode(), headers
=headers
)
156 bite_json
= json_result
['data']['web']['biteById']
159 'id': bite_json
['_id'],
160 'url': bite_json
['audio']['mp3']['url'],
161 'title': bite_json
['title'],
162 'uploader': traverse_obj(bite_json
, ('ownerObject', 'username'), expected_type
=strip_or_none
),
163 'uploader_id': traverse_obj(bite_json
, ('ownerObject', '_id'), expected_type
=strip_or_none
),
165 'tags': list(filter(None, map(strip_or_none
, (traverse_obj(bite_json
, 'userKeywords', expected_type
=list) or []))) or None),