예제 #1
0
파일: loader.py 프로젝트: tumani1/vsevi
 def get_url(self, load_function):
     url = "http://%s/%s" % (self.host, self.search_url, )
     response = load_function(url)
     filmLink = parsers.parse_search(response, self.film.name, self.film.release_date.year)
     if filmLink is None:
         raise NoSuchFilm(self.film)
     self.url_load = filmLink
     return "http://%s%s" % (self.host, self.url_load)
예제 #2
0
 def get_url(self, load_function):
     url = "http://%s/%s" % (self.host, self.search_url, )
     url = url_with_querystring(url, **self.params)
     response = load_function(url)
     film_url = parsers.parse_search(response, self.film.name, self.film.release_date.year)
     if film_url is None:
         raise NoSuchFilm(self.film)
     self.url_load = film_url
     return self.url_load
예제 #3
0
파일: loader.py 프로젝트: tumani1/vsevi
 def get_url(self, load_function):
     url = "http://%s/%s" % (self.host, self.search_url, )
     url = url_with_querystring(url, **self.params)
     response = load_function(url)
     film_url = parsers.parse_search(response, self.film.name, self.film.release_date)
     if film_url is None:
         raise NoSuchFilm(self.film)
     self.url_load = film_url
     return self.url_load
예제 #4
0
 def get_url(self, load_function):
     url = "http://%s/%s" % (self.host, self.search_url, )
     url = url_with_querystring(url, **self.params)
     response = load_function(url)
     film = parsers.parse_search(response, self.film)
     if film is None:
         raise NoSuchFilm(self.film)
     self.url_load = film['link']
     return "http://%s%s" % (self.host, self.url_load)
예제 #5
0
 def get_url(self, load_function):
     url = "http://%s/%s" % (
         self.host,
         self.search_url,
     )
     response = load_function(url)
     filmLink = parsers.parse_search(response, self.film.name,
                                     self.film.release_date.year)
     if filmLink is None:
         raise NoSuchFilm(self.film)
     self.url_load = filmLink
     return "http://%s%s" % (self.host, self.url_load)
예제 #6
0
파일: loader.py 프로젝트: tumani1/vsevi
    def get_url(self, load_function):
        url = "http://%s/%s" % (self.host, self.search_url)
        url = url_with_querystring(url, **self.params)

        response = load_function(url)

        link = parsers.parse_search(response, self.film.name, self.film.type, self.film.release_date.year)
        if link is None:
            raise NoSuchFilm(self.film)

        self.url_load = link
        return link
예제 #7
0
 def get_url(self, load_function):
     serial = False
     url = "http://%s/%s" % (
         self.host,
         self.search_url,
     )
     response = load_function(url)
     if self.film.type == APP_FILM_SERIAL:
         serial = True
     film_link = parsers.parse_search(response, self.film.name, serial)
     if film_link is None:
         raise NoSuchFilm(self.film)
     return film_link
예제 #8
0
def test_parse_search_results():
    with open('fixtures/search.html') as f:
        result = parsers.parse_search(f.read())
        assert len(result) == 8
예제 #9
0
def test_parse_search_results():
    with open('fixtures/search.html') as f:
        result = parsers.parse_search(f.read())
        assert len(result) == 8
예제 #10
0
def main():
  for keyword in utils.parse_keywords():
    print('Collecting data for \'' +keyword +'\'')
    parsers.parse_search(keyword)
예제 #11
0
def search(q):
    search_url = SEARCH_URL % urllib.quote_plus(q)
    html_result = utils.fetch_html(search_url)
    return parsers.parse_search(html_result)