1
0
Fork 0
mirror of https://github.com/blackjack4494/yt-dlc.git synced 2024-12-22 07:43:08 +00:00

[skip travis] create faq.md

how to redirect to another extractor
This commit is contained in:
Tom-Oliver Heidel 2020-09-13 00:47:45 +02:00 committed by GitHub
parent e02cdb31bb
commit dc6193cb22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

31
docs/faq.md Normal file
View file

@ -0,0 +1,31 @@
- Q: How to redirect to another extractor?
- A:
- Most simple using only `url_result`
```
# get proper url first if needed.
return self.url_result(url)
```
- Using `_request_webpage` and `to_screen` in addition
```
urlh = self._request_webpage(
url, id, note='Downloading redirect page')
url = urlh.geturl()
self.to_screen('Following redirect: %s' % url)
return self.url_result(url)
```
- Using `return` construction
```
return {
'_type': 'url_transparent',
'url': url,
'ie_key': ExampleIE.ie_key(),
'id': id,
}
# Alternative if extractor supports internal uri like kaltura
return {
'_type': 'url_transparent',
'url': 'kaltura:%s:%s' % (partner_id, kaltura_id),
'ie_key': KalturaIE.ie_key(),
'id': id,
}
```