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
('https://api.blerp.com/graphql',
153 audio_id
, data
=json
.dumps(data
).encode('utf-8'), headers
=headers
)
155 bite_json
= json_result
['data']['web']['biteById']
158 'id': bite_json
['_id'],
159 'url': bite_json
['audio']['mp3']['url'],
160 'title': bite_json
['title'],
161 'uploader': traverse_obj(bite_json
, ('ownerObject', 'username'), expected_type
=strip_or_none
),
162 'uploader_id': traverse_obj(bite_json
, ('ownerObject', '_id'), expected_type
=strip_or_none
),
164 'tags': list(filter(None, map(strip_or_none
, (traverse_obj(bite_json
, 'userKeywords', expected_type
=list) or []))) or None)