blob: b0f8cad149449bd4c7f4d0b9ecb183f25c266f9d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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,
}
```
|