Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for downloading files other than torrents #193

Open
john-catalano opened this issue Jan 30, 2022 · 3 comments
Open

Support for downloading files other than torrents #193

john-catalano opened this issue Jan 30, 2022 · 3 comments
Milestone

Comments

@john-catalano
Copy link

john-catalano commented Jan 30, 2022

I've been using Catch successfully (and happily) with ShowRSS for several years. Today, I had the idea that I'd like to use Catch to download podcasts via RSS. But, the podcast files are saved with a .torrent extension, despite the files being 40 to 100 MB. If I simply rename the file and add "mp3" in the place of "torrent", the file works fine and I can see all of the typical podcast metadata.

What switch do I need to flip to prevent this renaming?

Example, this RSS feed: https://atp.fm/rss

2022-01-31-619 Clipboard

2022-01-31-620 Clipboard

@john-catalano john-catalano changed the title Media files downloaded as .torrent files Media files downloaded and renamed with extension ".torrent" Feb 5, 2022
@mipstian mipstian added the bug label Feb 14, 2022
@mipstian
Copy link
Owner

Catch treats everything that isn't a magnet link as a .torrent file. It used to just preserve the file extension present in the feed, but turns out there are many feeds full of torrents with no extension.

You can work around this now by writing a download script that checks the extension and decides whether to download the file manually or launch a torrent client.

But I think long term we should change the app so it treats everything with no extension or a ".torrent" extension as a torrent file, and leaves everything else as is... I'm not sure though, Catch was never meant to download large files itself; the feed check will appear to have stalled until all downloads are complete, which is nor great. Needs more thought.

@mipstian mipstian changed the title Media files downloaded and renamed with extension ".torrent" Support for downloading files other than torrents Feb 14, 2022
@mipstian mipstian added enhancement and removed bug labels Feb 14, 2022
@john-catalano
Copy link
Author

"writing a download script"

Do you have any examples to post? I've searched this GitHub project and issues a few times and could not find any examples, or explanations about what kind of commands/syntax the script should have.

@mipstian
Copy link
Owner

mipstian commented Mar 9, 2022

Here's an example in Swift, obviously you can use whatever scripting language you want. The script only takes the url to download as an argument.

#!/usr/bin/env xcrun swift


import Foundation
import AppKit


precondition(CommandLine.arguments.count >= 2)

let downloadURL = CommandLine.arguments[1]

if downloadURL.hasPrefix("magnet:") {
  NSWorkspace.shared.open(URL(string: downloadURL)!)
} else {
  // do something else with downloadURL
}

@mipstian mipstian added this to the 2.4 milestone Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants