reduce the download size

Don't outside Hong Kong Section when download take place in Hong Kong
Determine by System Time Zone (HKT)
This commit is contained in:
Kennyl 2017-01-21 14:59:13 +08:00 committed by GitHub
parent 699a6a22da
commit b671517232

View File

@ -9,6 +9,7 @@ from calibre.utils.date import now as nowf
import os import os
import datetime import datetime
import re import re
import time
from calibre.web.feeds.recipes import BasicNewsRecipe from calibre.web.feeds.recipes import BasicNewsRecipe
from contextlib import nested from contextlib import nested
from calibre.ebooks.BeautifulSoup import BeautifulSoup from calibre.ebooks.BeautifulSoup import BeautifulSoup
@ -104,6 +105,15 @@ class AppleDaily(BasicNewsRecipe):
relativea = li.find('a', href=True).get('href', False) relativea = li.find('a', href=True).get('href', False)
a = 'http://hkm.appledaily.com/' + relativea a = 'http://hkm.appledaily.com/' + relativea
title = li.find('a', text=True).strip() title = li.find('a', text=True).strip()
if (time.tzname != 'HKT'):
if (title == u'三藩市'):
continue
if (title == u'洛杉磯'):
continue
if (title == u'紐  約'):
continue
if (title == u'美  國'):
continue
if (not title == u'動新聞') and (relativea.startswith('list.php')): if (not title == u'動新聞') and (relativea.startswith('list.php')):
sectionList.append((title, a)) sectionList.append((title, a))
for title, url in sectionList: for title, url in sectionList: