| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent cfafee1 commit 18ff01c
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,6 +9,7 @@ def __init__(self, url): | |||
| 9 | 9 | self.api = 'http://api.xfsub.com/xfsub_api/?url=' | |
| 10 | 10 | self.get_url_api = 'http://api.xfsub.com/xfsub_api/url.php' | |
| 11 | 11 | self.url = url.split('#')[0] | |
| 12 | + self.headers = {'Referer': 'http://api.xfsub.com/xfsub_api/?url=%s?qqdrsign=055a4' % self.url} | ||
| 12 | 13 | self.target = self.api + self.url | |
| 13 | 14 | self.s = requests.session() | |
| 14 | 15 | ||
@@ -40,9 +41,9 @@ def get_url(self): | |||
| 40 | 41 | 'key':self.info['key'], | |
| 41 | 42 | 'url':self.info['url'], | |
| 42 | 43 | 'type':''} | |
| 43 | - req = self.s.post(url=self.get_url_api,data=data) | ||
| 44 | + req = self.s.post(url=self.get_url_api,data=data, headers=self.headers) | ||
| 44 | 45 | url = self.server + json.loads(req.text)['url'] | |
| 45 | - req = self.s.get(url) | ||
| 46 | + req = self.s.get(url=url, headers=self.headers) | ||
| 46 | 47 | bf = BeautifulSoup(req.text,'xml') #因为文件是xml格式的,所以要进行xml解析。 | |
| 47 | 48 | video_url = bf.find('file').string #匹配到视频地址 | |
| 48 | 49 | return video_url | |
| Back | FazBrowse Home | New Git URL |
0 commit comments