From 5e98bb1b89690d63364479c7f76ff79325cfa2cb Mon Sep 17 00:00:00 2001 From: DiMartinoXBMC Date: Sat, 14 May 2016 12:04:25 +0300 Subject: [PATCH] 2016 fix --- .idea/workspace.xml | 303 +++++++++++++++++++----------- Content.py | 3 +- resources/contenters/CXZ.py | 4 +- resources/contenters/IMDB.py | 3 +- resources/contenters/KinoPoisk.py | 3 +- 5 files changed, 198 insertions(+), 118 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index cc551c0..8e0ab87 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,11 @@ - - + + + + @@ -34,11 +36,11 @@ - + - - + + @@ -129,7 +131,7 @@ - + @@ -139,6 +141,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -190,7 +238,7 @@ - + @@ -600,8 +648,8 @@ - - + + @@ -712,10 +760,6 @@ @@ -797,8 +845,6 @@ - - @@ -849,8 +895,28 @@ + + + + + + + + + + + + @@ -1047,13 +1113,6 @@ @@ -1410,7 +1476,7 @@ - + @@ -1440,7 +1506,6 @@ - @@ -1465,7 +1530,8 @@ - @@ -1474,34 +1540,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1667,6 +1705,7 @@ + @@ -1767,17 +1806,6 @@ - - - - - - - - - - - @@ -1820,8 +1848,8 @@ - - + + @@ -1897,54 +1925,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -2348,5 +2331,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Content.py b/Content.py index 8d4da4a..8322bce 100644 --- a/Content.py +++ b/Content.py @@ -26,6 +26,7 @@ import re from StringIO import StringIO import gzip import HTMLParser +from datetime import date import Localization from functions import log, debug @@ -89,7 +90,7 @@ class Content: } } - for y in range(2015, 1970, -1): + for y in range(date.today().year, 1970, -1): category_dict['year'][str(y)] = (str(y), '/top/y/%s/' % str(y)) def get_contentList(self, category, subcategory=None, apps_property=None): diff --git a/resources/contenters/CXZ.py b/resources/contenters/CXZ.py index b9b4c5f..964e014 100644 --- a/resources/contenters/CXZ.py +++ b/resources/contenters/CXZ.py @@ -22,7 +22,7 @@ import re import Content from BeautifulSoup import BeautifulSoup - +from datetime import date def make_category_dict(): category_dict = { @@ -72,7 +72,7 @@ def make_category_dict(): x[0], x[1] + 'view=list', {'page': x[1] + 'view=list&page=%d', 'increase': 1, 'second_page': 1}) category_dict['year'] = {'year': 'by Year', } - for y in range(2015, 1970, -1): + for y in range(date.today().year, 1970, -1): category_dict['year'][str(y)] = (str(y), '/films/year/%s/' % str(y), {'page': '/films/year/%s/' % str(y) + '?view=list&page=%d', 'increase': 1, 'second_page': 1}) diff --git a/resources/contenters/IMDB.py b/resources/contenters/IMDB.py index 1956a79..334648e 100644 --- a/resources/contenters/IMDB.py +++ b/resources/contenters/IMDB.py @@ -23,6 +23,7 @@ import HTMLParser import Content from BeautifulSoup import BeautifulSoup +from datetime import date class IMDB(Content.Content): @@ -65,7 +66,7 @@ class IMDB(Content.Content): } } - for y in range(2015, 1970, -1): + for y in range(date.today().year, 1970, -1): category_dict['year'][str(y)] = (str(y), '/year/%s/' % str(y)) regex_list = [] diff --git a/resources/contenters/KinoPoisk.py b/resources/contenters/KinoPoisk.py index e49e2f9..d8f040b 100644 --- a/resources/contenters/KinoPoisk.py +++ b/resources/contenters/KinoPoisk.py @@ -20,6 +20,7 @@ import re import socket +from datetime import date import Content from BeautifulSoup import BeautifulSoup @@ -70,7 +71,7 @@ class KinoPoisk(Content.Content): x[0], x[1] + 'perpage/25/', {'page': x[1] + 'perpage/25/page/%d/', 'increase': 1, 'second_page': 2}) category_dict['year'] = {'year': 'by Year', } - for y in range(2015, 1970, -1): + for y in range(date.today().year, 1970, -1): category_dict['year'][str(y)] = (str(y), '/s/type/film/list/1/m_act[year]/%s/' % str(y) + 'perpage/25/', {'page': '/s/type/film/list/1/m_act[year]/%s/' % str(y) + 'perpage/25/page/%d/', 'increase': 1, 'second_page': 2})