View Single Post
Old 09-14-2021, 09:59 AM   #1
Yevhen Kaplia
Junior Member
Yevhen Kaplia began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Sep 2021
Device: PocketBook Pro 903
RSS-recipe: How to get file from link in attribute und add in e-book?

I make my second recipe with RSS-feed and don't know to get file from link in attribute and add in e-book.

An example is article from 06. September 2021, 13:17 Uhr "Ein Jahr Ostberlin - Eine Vater-Sohn-Geschichte".
The attribute 'manuscript-download' has links to two files *.pdf and *.txt. How to get *.txt file only and add to e-book in recipe?

Code:
import string, re
from calibre import strftime
from calibre.web.feeds.recipes import BasicNewsRecipe
from calibre.ebooks.BeautifulSoup import BeautifulSoup
from calibre.web.feeds.news import BasicNewsRecipe

class AdvancedUserRecipe1631605042(BasicNewsRecipe):
    title          = 'dlf Das Feature'
    oldest_article = 10
    max_articles_per_feed = 100
    auto_cleanup   = True
    remove_tags = [dict(attrs={'class':['header', 'playbutton', 'largeImage', 'article-share', 'articleside', 'article-share']})]
    
    
    feeds          = [
        ('dlf Das Feature', 'https://www.deutschlandfunk.de/podcast-das-feature.1248.de.podcast.xml'),
    ]
Yevhen Kaplia is offline   Reply With Quote