This commit is contained in:
Kovid Goyal 2024-05-14 10:32:56 +05:30
parent 1705c82c9c
commit 70b435d432
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -2,10 +2,10 @@ import json
import re import re
import time import time
from datetime import datetime, timedelta from datetime import datetime, timedelta
from html5_parser import parse
from calibre.ebooks.BeautifulSoup import BeautifulSoup from calibre.ebooks.BeautifulSoup import BeautifulSoup
from calibre.web.feeds.news import BasicNewsRecipe, classes from calibre.web.feeds.news import BasicNewsRecipe, classes
from html5_parser import parse
class WSJ(BasicNewsRecipe): class WSJ(BasicNewsRecipe):
@ -30,7 +30,7 @@ class WSJ(BasicNewsRecipe):
''' '''
remove_tags = [ remove_tags = [
dict(name=['nav', 'svg', 'iframe', 'source']), dict(name=['nav', 'svg', 'iframe', 'source']),
dict(name='panel', attrs={'id':'metadata'}), dict(name='panel', attrs={'id':'metadata'}),
dict(name='panel', attrs={'layout':'inline'}), dict(name='panel', attrs={'layout':'inline'}),
dict(name='panel', attrs={'embed':'inner-article-ad'}), dict(name='panel', attrs={'embed':'inner-article-ad'}),
@ -87,7 +87,7 @@ class WSJ(BasicNewsRecipe):
br.addheaders += [ br.addheaders += [
('Accept-Encoding', 'gzip'), ('Accept-Encoding', 'gzip'),
('cache-control', 'no-cache'), ('cache-control', 'no-cache'),
('x-api-key', 'eb2408cd27f8913d421fa3d5c3d07ccf034cb448') ('x-api-key', ('e''b''2''4''0''8''c''d''2''7''f''8''9''1''3''d''4''2''1''f''a''3''d''5''c''3''d''0''7''c''c''f''0''3''4''c''b''4''4''8')),
] ]
return br return br