svtplay-dl: Issues with detecting and avoiding duplicates

svtplay-dl versions:

3.2

Operating system and Python version:

Windows 10 (2004) Python 3.8 (included in release) Python 3.9.2 (global install)

What is the issue:

There doesn’t seem to exist a consistent way avoiding to download duplicates, especially when the episode IDs might change.

When id’s has changed

svtplay-dl.exe --subtitle --all-episodes https://www.svtplay.se/exit when IDs have not changed will skip the already downloaded episodes unless -force is specified

When id’s have changed it will download the episode again.

Downloading only episodes after date

svtplay-dl.exe --subtitle --after-date 2021-03-06 https://www.svtplay.se/exit renders this error:

ERROR: No videos found. This mode is not supported anymore. Need the url with the video.

Downloading only latest 5 episodes

svtplay-dl.exe --subtitle --all-last 5 https://www.svtplay.se/exit render this error:

ERROR: No videos found. This mode is not supported anymore. Need the url with the video.

(Bad workaround) Downloading only missing episodes with some scripting

  1. Find the available episodes with svtplay-dl.exe --subtitle --all-episodes --get-only-episode-url https://www.svtplay.se/exit
  2. Exclude the local episodes by matching season and episode

The issue with this approach is that the output is 1) hard to parse and 2) is doesn’t return the s0Xe0X for you so you can’t easily match this with your local episodes. Is there an easier way parse the episode information from svtplay-dl?

(Better workaround) Download only missing via exclusion with powershell:

  1. Get a list of all local episodes and create a list of each s0Xe0X pattern
  2. Use the --exclude option to exclude episodes matching this pattern
svtplay-dl.exe --subtitle --all-episodes --exclude $((Get-Item * -Filter *.mp4 | ForEach-Object { $_.BaseName -replace '.*(s\d+e\d+).*','$1'}) -join ',') https://www.svtplay.se/exit

It works but it’s not especially fast.

(Future solution?) Custom output format

Can the output format be customized in any way? I’m thinking that specifying a custom output file format could help detecting duplicates when downloading multiple episodes.

Something like:

svtplay-dl.exe --all-episodes URL --episode-name-format '%series%.%season%%episode%%title%'

then if the file names match a existing local one it’ll be skipped, unless -force is supplied.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 23 (9 by maintainers)

Most upvoted comments

@spaam, yes of course, no worries, I was just wondering why nobody commented so I thought I had missed some trick or something 😃 Thank you!

@anttin2020 i planned to look at this issue this week. i thought crashes while downloading files is far more important than this issue.

Then I suggest to leave it “as is”; current file naming will soon be the new normality. It’s great to have got season and episode numbering added !

I’ve just compared auto file name generation between v3.2 and snap-shot 20210315_122154 and the latter creates a file name which includes season and episode numbers as it was before. That’s great !

However, sorry if I’m picky, there is a difference in the overall file name generation in use of hyphens and punctuations when comparing how file names were created using older versions of svtplay-dl and this snapshot version. With a more similar naming it would be so much easier to identify dups in an alphabetically sorted list. ( a changed hash will not match but that’s irrelevant since that is the trailing part of the file name ).

Below is an example from “Circus familj” https://www.svtplay.se/video/29652574/cirkus-familj/cirkus-familj-sasong-2-annorlunda-barn?modalId=jNwpYQX to illustrate the differences in use of hyphen and punctuation. “Legacy” file name (with its legacy hash): cirkus-familj.s02e02.2-annorlunda-barn-6bdb91d-svtplay File name created by snapshot version 20210315_122154: cirkus.familj.s02e02.2…annorlunda.barn-048bae9-svtplay