|
| 1 | +''' |
| 2 | + Plugin for ResolveURL |
| 3 | + Copyright (C) 2020 gujal |
| 4 | +
|
| 5 | + This program is free software: you can redistribute it and/or modify |
| 6 | + it under the terms of the GNU General Public License as published by |
| 7 | + the Free Software Foundation, either version 3 of the License, or |
| 8 | + (at your option) any later version. |
| 9 | +
|
| 10 | + This program is distributed in the hope that it will be useful, |
| 11 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | + GNU General Public License for more details. |
| 14 | +
|
| 15 | + You should have received a copy of the GNU General Public License |
| 16 | + along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | +''' |
| 18 | + |
| 19 | +from resolveurl.plugins.lib import helpers |
| 20 | +from resolveurl.plugins.__resolve_generic__ import ResolveGeneric |
| 21 | + |
| 22 | + |
| 23 | +class SBEmbedResolver(ResolveGeneric): |
| 24 | + name = "sbembed" |
| 25 | + domains = ["sbembed.com"] |
| 26 | + pattern = r'(?://|\.)(sbembed\.com)/(?:e|play)/([0-9a-zA-Z]+)' |
| 27 | + |
| 28 | + def get_media_url(self, host, media_id): |
| 29 | + return helpers.get_media_url(self.get_url(host, media_id), |
| 30 | + patterns=[r'''sources\s*:\s*\["(?P<url>[^"]+)''', |
| 31 | + r'''(?:file|src):\s*"(?P<url>[^"]+)'''], |
| 32 | + generic_patterns=False, |
| 33 | + result_blacklist=['dl', '.srt', '.vtt'], |
| 34 | + referer=False) |
| 35 | + |
| 36 | + def get_url(self, host, media_id): |
| 37 | + return self._default_get_url(host, media_id, template='https://{host}/play/{media_id}') |
0 commit comments