mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Lex Fridman Podcast recipe
This commit is contained in:
parent
85b9ac251a
commit
dc61e88089
@ -55,6 +55,8 @@ def parse_p(p):
|
|||||||
yield '</' + tag + '>'
|
yield '</' + tag + '>'
|
||||||
else:
|
else:
|
||||||
yield p['text']
|
yield p['text']
|
||||||
|
elif p.get('type', '') == 'hard_break':
|
||||||
|
yield '<br>'
|
||||||
|
|
||||||
|
|
||||||
class CaravanMagazine(BasicNewsRecipe):
|
class CaravanMagazine(BasicNewsRecipe):
|
||||||
|
BIN
recipes/icons/lex_fridman_podcast.png
Normal file
BIN
recipes/icons/lex_fridman_podcast.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 271 B |
44
recipes/lex_fridman_podcast.recipe
Normal file
44
recipes/lex_fridman_podcast.recipe
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
class lexfridman(BasicNewsRecipe):
|
||||||
|
title = 'Lex Fridman Podcast'
|
||||||
|
description = (
|
||||||
|
'Transcripts from Lex Fridman Podcast. Conversations about science, technology, history, '
|
||||||
|
'philosophy and the nature of intelligence, consciousness, love, and power. Lex is an AI '
|
||||||
|
'researcher at MIT and beyond. Download monthly.'
|
||||||
|
)
|
||||||
|
oldest_article = 30 # days
|
||||||
|
__author__ = 'unkn0wn'
|
||||||
|
language = 'en'
|
||||||
|
encoding = 'utf-8'
|
||||||
|
remove_attributes = ['style', 'height', 'width']
|
||||||
|
no_stylesheets = True
|
||||||
|
ignore_duplicate_articles = {'url'}
|
||||||
|
use_embedded_content = False
|
||||||
|
timefmt = ' [%b, %Y]'
|
||||||
|
cover_url = 'https://i.scdn.co/image/ab6765630000ba8a563ebb538d297875b10114b7'
|
||||||
|
|
||||||
|
extra_css = '''
|
||||||
|
.ts-name { font-weight:bold; }
|
||||||
|
.ts-timestamp { font-size:small; }
|
||||||
|
'''
|
||||||
|
|
||||||
|
keep_only_tags = [dict(name='article')]
|
||||||
|
remove_tags = [
|
||||||
|
dict(name=['svg']),
|
||||||
|
dict(name='div', attrs={'class':'episode-player'})
|
||||||
|
]
|
||||||
|
|
||||||
|
feeds = [
|
||||||
|
('Transcripts', 'https://lexfridman.com/feed/podcast/')
|
||||||
|
]
|
||||||
|
|
||||||
|
def print_version(self, url):
|
||||||
|
return url.split('?')[0][:-1] + '-transcript/'
|
||||||
|
|
||||||
|
def preprocess_html(self, soup):
|
||||||
|
for div in soup.findAll('div', attrs={'class':'ts-segment'}):
|
||||||
|
div.name = 'p'
|
||||||
|
for name in soup.findAll('span', attrs={'class':'ts-name'}):
|
||||||
|
name.name = 'div'
|
||||||
|
return soup
|
Loading…
x
Reference in New Issue
Block a user