(s: str)
| 309 | |
| 310 | |
| 311 | def _convert_v2_name_format(s: str) -> str: |
| 312 | replacements = { |
| 313 | "{id}": "%(id)s", |
| 314 | "{user[username]}": "%(uploader)s", |
| 315 | "{user[id]}": "%(uploader_id)s", |
| 316 | "{user[permalink_url]}": "%(uploader_url)s", |
| 317 | "{timestamp}": "%(timestamp)s", |
| 318 | "{title}": "%(title)s", |
| 319 | "{description}": "%(description)s", |
| 320 | "{duration}": "%(duration)s", |
| 321 | "{permalink_url}": "%(webpage_url)s", |
| 322 | "{license}": "%(license)s", |
| 323 | "{playback_count}": "%(view_count)s", |
| 324 | "{likes_count}": "%(like_count)s", |
| 325 | "{comment_count}": "%(comment_count)s", |
| 326 | "{reposts_count}": "%(respost_count)s", |
| 327 | "{playlist[author]}": "%(playlist_uploader)s", |
| 328 | "{playlist[title]}": "%(playlist)s", |
| 329 | "{playlist[id]}": "%(playlist_id)s", |
| 330 | "{playlist[tracknumber]}": "%(playlist_index)s", |
| 331 | "{playlist[tracknumber_total]}": "%(playlist_count)s", |
| 332 | } |
| 333 | for old, new in replacements.items(): |
| 334 | s = s.replace(old, new) |
| 335 | if not s.endswith(".%(ext)s"): |
| 336 | s += ".%(ext)s" |
| 337 | return s |
| 338 | |
| 339 | |
| 340 | def _build_ytdl_output_filename(scdl_args: SCDLArgs, in_playlist: bool, force_suffix: str | None = None) -> str: |
no outgoing calls
no test coverage detected