aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dl
diff options
context:
space:
mode:
authorJanez Troha <dz0ny@users.noreply.github.com>2013-11-13 18:34:03 +0100
committerJanez Troha <dz0ny@users.noreply.github.com>2013-11-13 18:34:03 +0100
commit9771cceb2cfab153d0c2a5b0a7dbc923de90f2c1 (patch)
tree724a31b8bddab6a56ee5315c01ac21a23c8f550b /youtube_dl
parentca715127a2f95da30b6700a5e217a2acc904b459 (diff)
downloadyoutube-dl-9771cceb2cfab153d0c2a5b0a7dbc923de90f2c1.zip
youtube-dl-9771cceb2cfab153d0c2a5b0a7dbc923de90f2c1.tar.gz
youtube-dl-9771cceb2cfab153d0c2a5b0a7dbc923de90f2c1.tar.bz2
Fix filename extension leaking to json filename
Makes writeinfojson behaving exactly as writethumbnail in case where filename contains mediafile extension. Case: video.mp4 converted to music.mp3 would yield music.mp4.info.json instead music.mp3.info.json or music.info.json
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/YoutubeDL.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py
index f615911..3160d97 100644
--- a/youtube_dl/YoutubeDL.py
+++ b/youtube_dl/YoutubeDL.py
@@ -655,7 +655,7 @@ class YoutubeDL(object):
return
if self.params.get('writeinfojson', False):
- infofn = filename + u'.info.json'
+ infofn = os.path.splitext(filename)[0] + u'.info.json'
self.report_writeinfojson(infofn)
try:
json_info_dict = dict((k, v) for k, v in info_dict.items() if not k in ['urlhandle'])