Skip to content

Post Processing

p0psicles edited this page Feb 12, 2021 · 21 revisions

What is Post Processing?

Post Processing is a name for a collection of actions that are taken after a file is downloaded. You can think of moving the file, renaming or any other process you prefer.

Post Processing explained

To start Post Processing in Medusa you have 4 possibility's.

  1. Scheduled post processing Let Medusa scan/monitor the TV Download Dir for newly downloaded episodes by your download client. Once Medusa detects a new file the Post processing starts.

  2. Manual Post Processing Manual Post Processing.

  3. Use a script like nzbToMedia/torrentToMedia A script is triggered from the download client each time a donwload finished. The script will inform Medusa that a new episode was downloaded. This is the ideal/preferred way for NAS devices. As this method doesn't need the constant scanning of the TV Download Dir it will allow the hard disks to go into sleep. Some might already be familiar with the SABtoSickbeard script that is used in combination with SABNZBz. However not all download clients support the running of those scripts after a download so Medusa can be informed.
    For more detailed information about an individual setting see the Main Settings Wiki.

  4. (experimental) Download Handler Download Handler. Note! As this is current an experimental feature, you'll need to enable experimental features in config > general > advanced.

Download Handler

A new feature that medusa offers, is using the download handler. The download handler uses a periodic check that contacts your download clients through their API. If a download is finished, it will post-process that resource directly. It has some other advantages, like:

  • Trigger specific actions on the torrent when download is finished or when the torrent has finished seeding
    • Configure a global seed ratio, or one per provider. Configuring a ratio of 0, will run the action after download instead of after seeding.
    • Set actions like pause torrent, remove torrent or remove torrent with data.
  • It only processes the files offered by the client. If you have other downloads in your completed folder, it won't touch those.
  • It runs async. Meaning a separated thread is spawn for the postprocessing. The UI will be available during postprocessing.
  • Configure the download handler interval in config -> postprocessing. Or start it manually in manage -> searches.
  • Use failed download handling. When a download failes or failes to process medusa will try to snatch a new candidate and directly send it to the client.

Manual Post Processing

Normally Medusa does Auto Post Processing but it gives you also the possibility to Manual Post Process files. This can be handy if you have manually downloaded files and want to instantly process them in Medusa. Simply hit the button Post-Processing at the top-right corner and the following screen will appear.:

Enter the folder containing the episode:
Browse to the folder you want to Post-Process.
Process Method to be used:
Lets you set the method for post-processing, you have the following options.

  • Copy
    Copy's the file to your show folder. (And so leaves a copy in your TV Download Dir present)
  • Move
    Moves the file to your show folder. (And so removes the file in your TV Download Dir) You cant use this if you are seeding the file.!
  • Hard link
    Creates a hard link in your shows folder, and leaves the file also in your TV Download Dir. This is ideal if you want to seed your file. Once you are done seeding simply let the download client remove the file.
  • Symbolic link
    Creates a link in your shows folder to the file inside your TV Download Dir. Note if you remove the file the link also doesn't work anymore.!
  • sync vs async Asyc will replace the sync option in time as the default option. Async will run the postprocess job in the background, but provide updates when the postprocess job has finished.

Force already Post Processed Dir/Files:
Forces already Post Processed Dir/Files, use only in case you have problems.
Mark Dir/Files as priority download:
?
Delete files and folders:
Medusa deletes the files and folders after completion of the manual Post-Processing.
Mark download as failed:
Lets you mark the downloaded episode as failed, and lets Medusa search/snatch an alternative file.

Extra Scripts:

Examples:
For Windows C:\Script\test.py
For Linux: /Script/test.py

Use single back slashes, Medusa/Python will escape them and make them double.
Scripts are called after Medusa's own post-processing.
Medusa will then wait for a feedback from your script before post-processing anything else.
Running non-Python scripts? See running external scripts.

Parameters that are passed:

  • argv[0]: File-path to Script
  • argv[1]: Final full path to the episode file
  • argv[2]: Original full path of the episode file
  • argv[3]: Show indexer ID
  • argv[4]: Season number
  • argv[5]: Episode number
  • argv[6]: Episode Air Date
Clone this wiki locally