-
Notifications
You must be signed in to change notification settings - Fork 0
/
AOSFetcher.py
36 lines (31 loc) · 1.13 KB
/
AOSFetcher.py
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
32
33
34
35
36
#-*- coding: utf-8 -*-
__author__ = 'kovtash'
from serviceFetcher import serviceFetcher
import cookielib, downloader
class AOSFetcher(serviceFetcher):
SHORT_NAME='AOS'
def downloadWorker(self,episodeUrl,tmpFilePath):
#return True #TODO: разблокировать загрузку файлов
aosCookie = cookielib.CookieJar()
aosCookie.set_cookie(self.makeCookie('UniversalUserID','fd720b1afbfd40d0bc484aec8651fe1e'))
headers = [('Referer', 'http://animeonline.su/'),('User-agent', 'Mozilla/5.0')]
return downloader.fetchfile(episodeUrl,tmpFilePath,cookie=aosCookie,headers=headers)
def makeCookie(self,name, value):
return cookielib.Cookie(
version=0,
name=name,
value=value,
port=None,
port_specified=False,
domain="myvi.ru",
domain_specified=True,
domain_initial_dot=False,
path="/",
path_specified=True,
secure=False,
expires=None,
discard=False,
comment=None,
comment_url=None,
rest=None
)