Skip to content

Commit 91a6e15

Browse files
committed
Fix video titles in JSON format
When using the `json` format, video titles have characters such as `:` and `'` stripped: $ tcd --video 497919915 --format json code review: dlloverflow's VPNMonitor (Python) [json] ./497919915.json $ jq .video.title 497919915.json "code review dlloverflows VPNMonitor (Python)" This happens because Pipe.output (called on tcd/downloader.py line 92) mutates video.data before it's written to the JSON file. Fix the bug by making Pipe.output not mutate its parameter object: $ python -m tcd --video 497919915 --format json code review: dlloverflow's VPNMonitor (Python) [json] ./497919915.json $ jq .video.title 497919915.json "code review: dlloverflow's VPNMonitor (Python)"
1 parent 3b5b18c commit 91a6e15

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tcd/pipe.py

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def output(self, video_data: Dict[str, Any]) -> str:
5858
"""
5959

6060
# Video title
61+
video_data = dict(video_data)
6162
video_data['title'] = Pipe.get_valid_filename(video_data['title'])
6263

6364
# Output directory and file

0 commit comments

Comments
 (0)