]>
Commit | Line | Data |
---|---|---|
dc6193cb TOH |
1 | - Q: How to redirect to another extractor? |
2 | - A: | |
3 | - Most simple using only `url_result` | |
4 | ``` | |
5 | # get proper url first if needed. | |
6 | return self.url_result(url) | |
7 | ``` | |
8 | - Using `_request_webpage` and `to_screen` in addition | |
9 | ``` | |
10 | urlh = self._request_webpage( | |
11 | url, id, note='Downloading redirect page') | |
12 | url = urlh.geturl() | |
13 | self.to_screen('Following redirect: %s' % url) | |
14 | return self.url_result(url) | |
15 | ``` | |
16 | - Using `return` construction | |
17 | ``` | |
18 | return { | |
19 | '_type': 'url_transparent', | |
20 | 'url': url, | |
21 | 'ie_key': ExampleIE.ie_key(), | |
22 | 'id': id, | |
23 | } | |
24 | # Alternative if extractor supports internal uri like kaltura | |
25 | return { | |
26 | '_type': 'url_transparent', | |
27 | 'url': 'kaltura:%s:%s' % (partner_id, kaltura_id), | |
28 | 'ie_key': KalturaIE.ie_key(), | |
29 | 'id': id, | |
30 | } | |
31 | ``` |