mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
update NIN Online. Fixes #5547 (Updated recipe for NIN online)
This commit is contained in:
parent
d88067518e
commit
e02d86fe90
@ -5,7 +5,7 @@ __copyright__ = '2008-2010, Darko Miletic <darko.miletic at gmail.com>'
|
||||
www.nin.co.rs
|
||||
'''
|
||||
|
||||
import re, urllib
|
||||
import re
|
||||
from calibre import strftime
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
@ -16,13 +16,13 @@ class Nin(BasicNewsRecipe):
|
||||
publisher = 'NIN d.o.o.'
|
||||
category = 'news, politics, Serbia'
|
||||
no_stylesheets = True
|
||||
delay = 1
|
||||
oldest_article = 15
|
||||
encoding = 'utf-8'
|
||||
needs_subscription = True
|
||||
remove_empty_feeds = True
|
||||
PREFIX = 'http://www.nin.co.rs'
|
||||
INDEX = PREFIX + '/?change_lang=ls'
|
||||
LOGIN = PREFIX + '/?logout=true'
|
||||
use_embedded_content = False
|
||||
language = 'sr'
|
||||
publication_type = 'magazine'
|
||||
@ -41,14 +41,12 @@ class Nin(BasicNewsRecipe):
|
||||
|
||||
def get_browser(self):
|
||||
br = BasicNewsRecipe.get_browser()
|
||||
br.open(self.INDEX)
|
||||
if self.username is not None and self.password is not None:
|
||||
data = urllib.urlencode({ 'login_name':self.username
|
||||
,'login_password':self.password
|
||||
,'imageField.x':'32'
|
||||
,'imageField.y':'15'
|
||||
})
|
||||
br.open(self.LOGIN,data)
|
||||
br.open(self.INDEX)
|
||||
br.select_form(name='form1')
|
||||
br['login_name' ] = self.username
|
||||
br['login_password'] = self.password
|
||||
br.submit()
|
||||
return br
|
||||
|
||||
keep_only_tags =[dict(name='td', attrs={'width':'520'})]
|
||||
|
Loading…
x
Reference in New Issue
Block a user