Skip to content

Conversation

@bastimeyer
Copy link
Member

  • add streamlink_cli.utils.path.replace_path
  • refactor streamlink_cli.utils.formatter.Formatter
    • rename filename() to path() and return a pathlib.Path object
    • format path parts separately
    • replace dot and double-dot path parts if not explicit user input
    • replace unsupported chars in path parts (like before)
  • refactor streamlink_cli.output.FileOutput
    • turn filename into a Path object
    • create parent directories before creating the file descriptor
  • update streamlink_cli.main accordingly
  • update and add new tests

resolves #4081

$ streamlink -o '{author}/{category}/{title}.ts' twitch.tv/dota2ti best
[cli][info] Found matching plugin twitch for URL twitch.tv/dota2ti
[cli][info] Available streams: audio_only, 160p (worst), 360p, 480p, 720p, 720p60, 1080p60 (best)
[cli][info] Opening stream: 1080p60 (hls)
[plugins.twitch][info] Will skip ad segments
[plugins.twitch][info] Low latency streaming (HLS live edge: 2)
[plugins.twitch][info] Waiting for pre-roll ads to finish, be patient
[stream.hls][info] Filtering out segments and pausing stream output                                                                     [stream.hls][info] Resuming stream output
[download][.. - Group Stage Day 4.ts] Written 8.0 MB (9s @ 839.8 KB/s)                                                                          ^C[cli][info] Stream ended
Interrupted! Exiting...
[cli][info] Closing currently open stream...

$ ls dota2ti/Dota\ 2/Dota\ 2\ The\ International\ -\ Group\ Stage\ Day\ 4.ts 
'dota2ti/Dota 2/Dota 2 The International - Group Stage Day 4.ts'

- add streamlink_cli.utils.path.replace_path
- refactor streamlink_cli.utils.formatter.Formatter
  - rename filename() to path() and return a pathlib.Path object
  - format path parts separately
  - replace dot and double-dot path parts if not explicit user input
  - replace unsupported chars in path parts (like before)
- refactor streamlink_cli.output.FileOutput
  - turn filename into a Path object
  - create parent directories before creating the file descriptor
- update streamlink_cli.main accordingly
- update and add new tests
@bastimeyer bastimeyer force-pushed the cli/output/fileoutput branch from f49119b to 743e763 Compare October 10, 2021 14:09
@back-to back-to merged commit e152c53 into streamlink:master Oct 10, 2021
@bastimeyer bastimeyer deleted the cli/output/fileoutput branch October 10, 2021 18:45
snorkelopstesting1-a11y pushed a commit to snorkel-marlin-repos/streamlink_streamlink_pr_4085_538d0190-935d-4c2e-8f9b-ffbae9f0c107 that referenced this pull request Oct 22, 2025
Original PR #4085 by bastimeyer
Original: streamlink/streamlink#4085
snorkelopstesting3-bot added a commit to snorkel-marlin-repos/streamlink_streamlink_pr_4085_538d0190-935d-4c2e-8f9b-ffbae9f0c107 that referenced this pull request Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create new directory upon no such directory found.

2 participants