janw / podcast-archiver

Archive all your favorite podcasts
MIT License
122 stars 21 forks source link

Support file URLs #179

Closed elharo closed 2 months ago

elharo commented 2 months ago

I'm trying to archive a podcast from a locally stored rss file and it fails like so:

podcast-archiver -f "file:/Users/elharo/Downloads/local.rss"
...
 File "/opt/homebrew/Cellar/podcast-archiver/1.5.0/libexec/lib/python3.12/site-packages/podcast_archiver/cli.py", line 298, in main
    pa.run()
  File "/opt/homebrew/Cellar/podcast-archiver/1.5.0/libexec/lib/python3.12/site-packages/podcast_archiver/base.py", line 58, in run
    result = self.processor.process(url)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/podcast-archiver/1.5.0/libexec/lib/python3.12/site-packages/podcast_archiver/processor.py", line 52, in process
    feed = Feed.from_url(url)
           ^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/podcast-archiver/1.5.0/libexec/lib/python3.12/site-packages/podcast_archiver/models.py", line 195, in from_url
    return cls(page=FeedPage.from_url(url), url=url)
                    ^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/podcast-archiver/1.5.0/libexec/lib/python3.12/site-packages/podcast_archiver/models.py", line 167, in from_url
    response = session.get(url, allow_redirects=True, timeout=REQUESTS_TIMEOUT)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/podcast-archiver/1.5.0/libexec/lib/python3.12/site-packages/requests/sessions.py", line 602, in get
    return self.request("GET", url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/podcast-archiver/1.5.0/libexec/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/podcast-archiver/1.5.0/libexec/lib/python3.12/site-packages/requests/sessions.py", line 697, in send
    adapter = self.get_adapter(url=request.url)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/podcast-archiver/1.5.0/libexec/lib/python3.12/site-packages/requests/sessions.py", line 792, in get_adapter
    raise InvalidSchema(f"No connection adapters were found for {url!r}")

I also tried file://Users/elharo/Downloads/local.rss and file:///Users/elharo/Downloads/local.rss