larry1chan@qq.com 4 дней назад
Родитель
Сommit
d9a27cdb24
2 измененных файлов с 12 добавлено и 2 удалено
  1. 10 1
      recipe/oriental_daily_pure.recipe
  2. 2 1
      recipe/upkindle.sh

+ 10 - 1
recipe/oriental_daily_pure.recipe

@@ -79,7 +79,13 @@ class OrientalDailyPure(BasicNewsRecipe):
 
         urlRoot = 'https://orientaldaily.on.cc'
         url = urlRoot 
+
+        print ('############ before soup')
+
         soup = self.index_to_soup(url)
+
+        print ('############ after soup')
+
         #lookups = ['news', 'china_world', 'finance', 'lifestyle', 'sport']
         lookups = ['news', 'china_world', 'finance', 'entertainment', 'lifestyle', 'adult', 'sport']
         # no finanical news on Sunday
@@ -131,5 +137,8 @@ class OrientalDailyPure(BasicNewsRecipe):
 
     def get_browser(self, *args, **kwargs):
         br = BasicNewsRecipe.get_browser(self)
-        br.set_header('User-Agent', value='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36') 
+#        br.set_header('User-Agent', value='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36') 
+        br.set_header('User-Agent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36')
+        br.set_header('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8')
+        br.set_header('Accept-Language', 'en-US,en;q=0.5')
         return br

+ 2 - 1
recipe/upkindle.sh

@@ -22,7 +22,8 @@ ebook-convert $MOBIPATH/$TODAY-orient.mobi $MOBIPATH/$TODAY-orient.epub
 #  send book to kindle
 #
 #calibre-smtp  --subject "oriental news $TODAY" --attachment $MOBIPATH/$TODAY-orient.epub --relay hwsmtp.exmail.qq.com --port 465 --username vortify-lc@algometic.com --password "samP@n?1" --encryption-method SSL vortify-lc@algometic.com larry1chan11@kindle.com ""
-calibre-smtp  --subject "oriental news $TODAY" --attachment $MOBIPATH/$TODAY-orient.epub --relay smtp.qq.com --port 587 --username larry1chan@qq.com --password "xhybazbbucdyceed" --encryption-method SSL larry1chan@qq.com larry1chan11@kindle.com ""
+calibre-smtp  --subject "oriental news $TODAY" --attachment $MOBIPATH/$TODAY-orient.epub --relay smtp.qq.com --port 465 --username larry1chan@qq.com --password "xhybazbbucdyceed" --encryption-method SSL larry1chan@qq.com larry1chan11@kindle.com ""
+#calibre-smtp  --subject "oriental news $TODAY" --attachment $MOBIPATH/$TODAY-orient.epub --relay smtp.qq.com --port 587 --username larry1chan@qq.com --password "xhybazbbucdyceed" --encryption-method SSL larry1chan@qq.com larry1chan11@kindle.com ""
 
 #
 #  rm mobi file