From b671517232d9a805bfbcedd2203d729e1d9b3b77 Mon Sep 17 00:00:00 2001 From: Kennyl Date: Sat, 21 Jan 2017 14:59:13 +0800 Subject: [PATCH] reduce the download size Don't outside Hong Kong Section when download take place in Hong Kong Determine by System Time Zone (HKT) --- recipes/apple_daily.recipe | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/recipes/apple_daily.recipe b/recipes/apple_daily.recipe index 1f804feb6d..b96b6e4b05 100644 --- a/recipes/apple_daily.recipe +++ b/recipes/apple_daily.recipe @@ -9,6 +9,7 @@ from calibre.utils.date import now as nowf import os import datetime import re +import time from calibre.web.feeds.recipes import BasicNewsRecipe from contextlib import nested from calibre.ebooks.BeautifulSoup import BeautifulSoup @@ -104,6 +105,15 @@ class AppleDaily(BasicNewsRecipe): relativea = li.find('a', href=True).get('href', False) a = 'http://hkm.appledaily.com/' + relativea 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')): sectionList.append((title, a)) for title, url in sectionList: