浏览代码

warn if %(stitle)s is being used

Philipp Hagemeister 12 年之前
父节点
当前提交
97cd3afc75
共有 2 个文件被更改,包括 4 次插入1 次删除
  1. 3 0
      youtube_dl/FileDownloader.py
  2. 1 1
      youtube_dl/__init__.py

+ 3 - 0
youtube_dl/FileDownloader.py

@@ -94,6 +94,9 @@ class FileDownloader(object):
 		self._screen_file = [sys.stdout, sys.stderr][params.get('logtostderr', False)]
 		self.params = params
 
+		if '%(stitle)s' in self.params['outtmpl']:
+			self.to_stderr(u'WARNING: %(stitle)s is deprecated. Use the %(title)s and the --restrict-filenames flag(which also secures %(uploader)s et al) instead.')
+
 	@staticmethod
 	def format_bytes(bytes):
 		if bytes is None:

+ 1 - 1
youtube_dl/__init__.py

@@ -532,7 +532,7 @@ def _real_main():
 			parser.error(u'you must provide at least one URL')
 		else:
 			sys.exit()
-	
+
 	try:
 		retcode = fd.download(all_urls)
 	except MaxDownloadsReached: