Podcast - episode download

Now I am using podcast rss feed in Devonthink, to track new episode as well as keep a history of old episodes of the selected podcast, and Devonthink retrieve the episodes’ note and audio file links (mp3/m4a mostly), which can be used for download.

For example, there is one podcast about Astronomy and have a few hundred episodes so far, and host introduce a couple of series from last year, that may contain few dozens episodes for each series, and each episodes around 10 minutes.

I would like to download all episodes for a series and merge them into m4b, for archive and for play on my phone when outside…it would be helpful to have a smart rule to do such, or better, if the Download manager can support such downloads with selected episodes :slight_smile:

One reason behind the request is the flourishing topics and contents in podcast/audio files, and another reason is the reduced vision with sore eyes from staring at screens.

Merging media files is beyond the scope of DEVONthink.
What is the podcast URL?

(<![CDATA[天文随心听|讲述宇宙与人的故事]]>)

Since Devonthink can get each individual episode audio-file-links, which can be used for download, it would be easier to have a smart rule, to download selected episodes in a bunch, than to manually download each selected episode one by one. (my mentioning of Download manager may be misleading, I was thinking about Download manager’s “download” capability, that could be applied in a smart rule)

I use audiobookbinder to merge mp3 files into m4b.

Thanks for the URL!

And what if you don’t want to waste the bandwidth and space to download episodes you may not be interested in? This is a legitimate question too as adding this RSS feed downloads 462 news articles. That would be an extraordinary load to just start blindly downloading with no curation.

Agreed. What I mean is to just download a dozen of episodes that belong to the same series, e.g. the host introduced season-1 of a series (“quantum”) from a year before, that contains 20+ episodes among other hundred of other episodes, and I want to be able to select these 20+ episodes and download them as a bunch, then I can merge them into one m4b file to listen on the phone, also if the audio-file-names can be replaced with the episode-name, that would be ideal.

In this case, it seems reasonable to Option-click the link in the desired new article as this add the URL to the Download Manager. (I actually use this mechanism every day :smiley: )

You could also try this quick snippet of code to process a selection of news articles in a feed…

property mediaType: "m4a"

	tell application id "DNtp"
		if selection = {} then return		
		repeat with theRecord in theRecords
			if (type of theRecord = html) and (type of location group of theRecord = feed) then
				set possibleLinks to get links of (source of theRecord as string) type mediaType
				if (possibleLinks ≠ {}) then
					repeat with theLink in possibleLinks
						try
							add download theLink
						on error msg
							log message "Download Failed." info msg
						end try
					end repeat
				end if
			end if
		end repeat
	end tell

Thank you :slight_smile: Option-click is quick and good to know, but I don’t know how to make the code work for my selections, i.e. I save the code as script and add it to DT’s menu, when I select a few articles/episodes and apply the script, nothing happens and no download added to the Download manager

Run the script in Script Editor with a news article selected. Does it error?

error “The variable theRecords is not defined.” number -2753 from “theRecords”

Ahh… that was from a previous bit of code.

Change the first repeat line to…

repeat with theRecord in (selected records)

Works like a charm now :slight_smile:

I want to continue work on the script, e.g. to change the downloaded audio files’ name to the episode name, any book reference for Apple script beginner…thanks again!

There is very much a use case for archiving RSS attachments, but I don’t think DevonThink is the right tool for this. It sounds like you’re happy with the AppleScript solution, but if you grow weary of the manual process, take a look at “gPodder”. It’s not a pretty app, but you can set it to download and retain as many episodes as you’d like, and from there it’s a simple thing to dig into its download folders and copy the audio files to elsewhere.

Glad to hear it’s working and sorry for the late night mistake. It was after 1am without my glasses on :smiley:

Thank you for the note. I use Devonthink to keep a history of the feed, and for podcast, it gets episodes’ note and audio link, which is sufficient for me, and sometimes I want to download a few episodes or a series so I can listen on my phone, but not regular heavy download…currently I have close to dozen podcasts in Devonthink which have total 4000 episodes’ data retrieved, and it only takes up 11.5MB space :slight_smile:

1 Like