From 21ed07d178d9afdcf64bb93278ec5bf8f3dcb2f8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 25 Dec 2015 08:03:34 +0530 Subject: [PATCH] Update Financial Times. Fixes #1529141 [Financial Times UK and Interantional edition not working](https://bugs.launchpad.net/calibre/+bug/1529141) --- recipes/financial_times_uk.recipe | 17 +++++++++-------- recipes/financial_times_us.recipe | 15 ++++++++------- recipes/icons/financial_times_uk.png | Bin 1367 -> 391 bytes recipes/icons/financial_times_us.png | Bin 1367 -> 391 bytes 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/recipes/financial_times_uk.recipe b/recipes/financial_times_uk.recipe index 87e898929d..c144c51201 100644 --- a/recipes/financial_times_uk.recipe +++ b/recipes/financial_times_uk.recipe @@ -1,7 +1,7 @@ __license__ = 'GPL v3' -__copyright__ = '2010-2014, Darko Miletic ' +__copyright__ = '2010-2015, Darko Miletic ' ''' -www.ft.com/intl/uk-edition +www.ft.com/uk-edition ''' from calibre.ptempfile import PersistentTemporaryFile @@ -25,9 +25,8 @@ class FinancialTimes(BasicNewsRecipe): articles_are_obfuscated = True temp_files = [] masthead_url = 'http://im.media.ft.com/m/img/masthead_main.jpg' - LOGIN = 'https://registration.ft.com/registration/barrier/login' - LOGIN2 = 'http://media.ft.com/h/subs3.html' - INDEX = 'http://www.ft.com/intl/uk-edition' + LOGIN = 'https://accounts.ft.com/login?location=http%3A%2F%2Fwww.ft.com%2Fhome%2Fuk' + INDEX = 'http://www.ft.com/uk-edition' PREFIX = 'http://www.ft.com' def get_browser(self): @@ -35,8 +34,8 @@ class FinancialTimes(BasicNewsRecipe): br.open(self.INDEX) if self.username is not None and self.password is not None: br.open(self.LOGIN) - br.select_form(name='loginForm') - br['username'] = self.username + br.select_form(name='login') + br['email' ] = self.username br['password'] = self.password br.submit() return br @@ -48,7 +47,9 @@ class FinancialTimes(BasicNewsRecipe): dict(name='div', attrs={'id':'floating-con'}), dict(name=['meta','iframe','base','object','embed','link']), dict(attrs={'class':['storyTools','story-package','screen-copy','story-package separator','expandable-image','promobox']}), - dict(name='div', attrs={'class':lambda x: x and 'insideArticleRelatedTopics' in x.split()}) + dict(name='div', attrs={'class':lambda x: x and 'insideArticleRelatedTopics' in x.split()}), + dict(name='div', attrs={'class':lambda x: x and 'ft-new-story-tools-box' in x.split()}), + dict(name='div', attrs={'class':['railMiniVideo','ftbf-syndicationIndicator']}) ] remove_attributes = ['width','height','lang'] diff --git a/recipes/financial_times_us.recipe b/recipes/financial_times_us.recipe index 790f275ee3..73eb2f9ce3 100644 --- a/recipes/financial_times_us.recipe +++ b/recipes/financial_times_us.recipe @@ -1,7 +1,7 @@ __license__ = 'GPL v3' -__copyright__ = '2010-2013, Darko Miletic ' +__copyright__ = '2010-2015, Darko Miletic ' ''' -www.ft.com/intl/international-edition +www.ft.com/international-edition ''' from calibre.ptempfile import PersistentTemporaryFile @@ -26,9 +26,8 @@ class FinancialTimes(BasicNewsRecipe): articles_are_obfuscated = True temp_files = [] masthead_url = 'http://im.media.ft.com/m/img/masthead_main.jpg' - LOGIN = 'https://registration.ft.com/registration/barrier/login' - LOGIN2 = 'http://media.ft.com/h/subs3.html' - INDEX = 'http://www.ft.com/intl/international-edition' + LOGIN = 'https://accounts.ft.com/login?location=http%3A%2F%2Fwww.ft.com%2Fhome%2Fuk' + INDEX = 'http://www.ft.com/international-edition' PREFIX = 'http://www.ft.com' conversion_options = { @@ -44,8 +43,8 @@ class FinancialTimes(BasicNewsRecipe): br.open(self.INDEX) if self.username is not None and self.password is not None: br.open(self.LOGIN) - br.select_form(name='loginForm') - br['username'] = self.username + br.select_form(name='login') + br['email' ] = self.username br['password'] = self.password br.submit() return br @@ -58,6 +57,8 @@ class FinancialTimes(BasicNewsRecipe): ,dict(name=['meta','iframe','base','object','embed','link']) ,dict(attrs={'class':['storyTools','story-package','screen-copy','story-package separator','expandable-image','promobox']}) ,dict(name='div', attrs={'class':lambda x: x and 'insideArticleRelatedTopics' in x.split()}) + ,dict(name='div', attrs={'class':lambda x: x and 'ft-new-story-tools-box' in x.split()}) + ,dict(name='div', attrs={'class':['railMiniVideo','ftbf-syndicationIndicator']}) ] remove_attributes = ['width','height','lang'] diff --git a/recipes/icons/financial_times_uk.png b/recipes/icons/financial_times_uk.png index 687c1551bbc87ccf4f2354cbb02a0628d9eb95b7..0a9c6ad4af48cece797cd1be771b5f868df31037 100644 GIT binary patch literal 391 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP~kA$GPnb6{@3^S{rz8(d%fOXfBXNsxV-=NvA4hezp|~e;HUrfvcLY_+`s?7zqs+g z4iArj{)d7M2Ymm3ddkfV1c%!sO(W)>J$(3}!D7|+#>R*IX%ap&Ha7wR<06Le9}1m^ z*Z%#)tTaRD;h}^@iyNbbXD!sJ|F@v3vAwyK@!4#9jjsO(UfQqFJMhfM$1uXjA*03S z@%rf5|KfLiYIu02m%YGIUYePWlatZn|Iu!Kp6I@q16t>QyuM}C6{IB0+}a@JIn#;x gU%(5duEPur{ZrdMpR-Eq0|ps`r>mdKI;Vst066cY#{d8T literal 1367 zcmV-d1*rOoP)<4B?x%{jg5ckX%4Z=U(y`+e@c-}}sHG~9}5c$(C3drw25OnnnYa#4Cv+>F&| zdPG5-_b|*Oct5$ccD!HtbzaM0HMNRdzV< zuTF1Lm~c8`iV&8)leIQWAW+B*}{No;Q8+s8ORvj?~f|F>;*F*r~?)))q$CEGtvK zGM%KSrKL4adyM5|Lu)HjJPq}A!2{OO9&2W#Z#~U;hJ^`^?7&@`5p;2nPa{E1ZuFx| zk^|dT*jgBM?=!Gn=id6dIvgZ9%r!aE?P#=TW|YU8h1SD0M-V8^&pBD{y?4uU2V1jV z{RaacucJ+V$x-eKsS*Z(i@jyZ;lN9KeXPw5l?1e&&V0BS8MM}Z(2(KnyY#lVnUbIA zC(07Vv!uEr*|QTN#9irNCG~Uucv&J|rBKz-bqj`RjsR?HZk!`qFCHHdPYzx`;7e^K zK8|I_x1X1-pKdl$NuU(g`}DdS(fAA=s@b7yp9M3`?jG49s*Z`OqopT;qkWy|4SAHF z2^IJDiZ_SQ#jXvDIV=RTElsZN_fejvTmf;>p@4f?!IYgQo0}LkW`Mk^FGSEZ>d>WU ze+o^|Y=wVz;wEY}$zVL)dwFt)Qs5>sk?u6|Cjpv+fKF0bdSx}m&~E0`c{Wof=x7feu8C|a&W2J1qL4(@9|%}W6L@Kz z02TG@H%NE9HimqB)Djx3VfMn1X0Rt><#c=}G)(ME!sb_!Wg{TTM zg9|f)!n_xPg8=1;`)U&m8K#L35-d>oix(;4dGh_#t@I-yXeCohbOQYi0k;q`Wh_+$ z$n@sHO_UO=yDp{rTnxP6MsX?BhYJy8)bhyhfAC+dyk#w|?Q%n7iT1o#xEZU?;3J`{sT)W-+LC~u%=(83wRy2P)4lrK z7}nZrQa;joLbov0w{3w5-3oyyPZ5t25IC}FGS%q+5?vKSRpn-2-kXD4BY2X88v|?Eh+s>dgQN^#0{XM~d0^~)L(J#B|8}o>+Skrek&w&4Q+*UBFZ$vLwu%3?f z;y3x9WWaMFB_K`Wks)ii=&T(@IJkJk7H Z&kyJm9i=@Pft~;W002ovPDHLkV1lL7jRyb# diff --git a/recipes/icons/financial_times_us.png b/recipes/icons/financial_times_us.png index 687c1551bbc87ccf4f2354cbb02a0628d9eb95b7..0a9c6ad4af48cece797cd1be771b5f868df31037 100644 GIT binary patch literal 391 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP~kA$GPnb6{@3^S{rz8(d%fOXfBXNsxV-=NvA4hezp|~e;HUrfvcLY_+`s?7zqs+g z4iArj{)d7M2Ymm3ddkfV1c%!sO(W)>J$(3}!D7|+#>R*IX%ap&Ha7wR<06Le9}1m^ z*Z%#)tTaRD;h}^@iyNbbXD!sJ|F@v3vAwyK@!4#9jj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