mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Bloomberg
This commit is contained in:
parent
37e21f78ee
commit
04638feeb9
@ -176,15 +176,16 @@ class Bloomberg(BasicNewsRecipe):
|
|||||||
caption = '<span class="cap">' + data['lede']['alt'] + '</span>'
|
caption = '<span class="cap">' + data['lede']['alt'] + '</span>'
|
||||||
|
|
||||||
if m:
|
if m:
|
||||||
time.sleep(10)
|
time.sleep(5)
|
||||||
body = data['body']
|
body = data['body']
|
||||||
else:
|
else:
|
||||||
body = ''
|
body = ''
|
||||||
body_data = data['body']['content']
|
body_data = data['body']['content']
|
||||||
for x in body_data:
|
for x in body_data:
|
||||||
pause = random.choice((0.25, 0.5, 0.75, 1))
|
|
||||||
time.sleep(pause)
|
|
||||||
body += get_contents(x)
|
body += get_contents(x)
|
||||||
|
pause = random.choice((4, 5, 6, 7, 8, 9))
|
||||||
|
self.log('Delay: ', pause, ' seconds')
|
||||||
|
time.sleep(pause)
|
||||||
return '<html><body>' + cat + title + subhead + auth + lede + caption + '<div>' + body + '</div></body></html>'
|
return '<html><body>' + cat + title + subhead + auth + lede + caption + '<div>' + body + '</div></body></html>'
|
||||||
|
|
||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
|
@ -170,15 +170,16 @@ class Bloomberg(BasicNewsRecipe):
|
|||||||
caption = '<span class="cap">' + data['lede']['alt'] + '</span>'
|
caption = '<span class="cap">' + data['lede']['alt'] + '</span>'
|
||||||
|
|
||||||
if m:
|
if m:
|
||||||
time.sleep(3)
|
time.sleep(5)
|
||||||
body = data['body']
|
body = data['body']
|
||||||
elif m2:
|
elif m2:
|
||||||
body = ''
|
body = ''
|
||||||
body_data = data['body']['content']
|
body_data = data['body']['content']
|
||||||
for x in body_data:
|
for x in body_data:
|
||||||
pause = random.choice((0.25, 0.5, 0.75, 1))
|
|
||||||
time.sleep(pause)
|
|
||||||
body += get_contents(x)
|
body += get_contents(x)
|
||||||
|
pause = random.choice((4, 5, 6, 7, 8, 9))
|
||||||
|
self.log('Delay: ', pause, ' seconds')
|
||||||
|
time.sleep(pause)
|
||||||
return '<html><body>' + cat + title + subhead + auth + lede + caption + '<div>' + body + '</div></body></html>'
|
return '<html><body>' + cat + title + subhead + auth + lede + caption + '<div>' + body + '</div></body></html>'
|
||||||
|
|
||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user