Skip to content

added filename->out option for aria2#1660

Merged
cvium merged 3 commits intoFlexget:developfrom
mitalhp:develop
Feb 10, 2017
Merged

added filename->out option for aria2#1660
cvium merged 3 commits intoFlexget:developfrom
mitalhp:develop

Conversation

@mitalhp
Copy link
Copy Markdown
Contributor

@mitalhp mitalhp commented Jan 27, 2017

Motivation for changes:

I am pulling down a podcast feed which uses random strings for filenames, but there was no way to pass in the "--out" parameter to aria to make it rename the file

Detailed changes:

Used the same logic that was there for path for filename

Example config:

tasks:
  podcast-1:
    rss:
      url: https://podcast.feed/rss.xml
    regexp:
      accept:
        - .*
    aria2:
      path: '/downloads'
      filename: '{{title|pathscrub}}.mp4'

entry.fail('failed to render \'path\': %s' % e)
return
try:
options['out'] = os.path.expanduser(entry.render(config['filename']))
Copy link
Copy Markdown
Contributor

@cvium cvium Jan 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will throw a KeyError exception if 'filename' is not specified. You should check that it actually exists before trying to render etc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh, didnt test that. will update and resubmit.

Copy link
Copy Markdown
Contributor Author

@mitalhp mitalhp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@cvium cvium merged commit 8b8d2c2 into Flexget:develop Feb 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants