diff --git a/devscripts/release.sh b/devscripts/release.sh index 543634ce1..561499ccb 100755 --- a/devscripts/release.sh +++ b/devscripts/release.sh @@ -25,7 +25,7 @@ make clean nosetests --with-coverage --cover-package=youtube_dl --cover-html test || exit 1 echo "\n### Changing version in version.py..." -sed -i~ "s/__version__ = '.*'/__version__ = '$version'/" youtube_dl/version.py +sed -i "s/__version__ = '.*'/__version__ = '$version'/" youtube_dl/version.py echo "\n### Committing CHANGELOG README.md and youtube_dl/version.py..." make README.md @@ -81,6 +81,6 @@ ROOT=$(pwd) git push "$ROOT" gh-pages git push "$ORIGIN_URL" gh-pages ) -rm -r build +rm -rf build echo "\n### DONE!" diff --git a/youtube_dl/InfoExtractors.py b/youtube_dl/InfoExtractors.py index 5fbca1c05..dcd7ca647 100755 --- a/youtube_dl/InfoExtractors.py +++ b/youtube_dl/InfoExtractors.py @@ -3541,10 +3541,12 @@ class JustinTVIE(InfoExtractor): video_extension = os.path.splitext(video_url)[1][1:] video_date = re.sub('-', '', clip['start_time'][:10]) video_uploader_id = clip.get('user_id', clip.get('channel_id')) + video_id = clip['id'] + video_title = clip.get('title', video_id) info.append({ - 'id': clip['id'], + 'id': video_id, 'url': video_url, - 'title': clip['title'], + 'title': video_title, 'uploader': clip.get('channel_name', video_uploader_id), 'uploader_id': video_uploader_id, 'upload_date': video_date, diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 51c5ad920..532e8c782 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -409,7 +409,10 @@ def encodeFilename(s): # match Windows 9x series as well. Besides, NT 4 is obsolete.) return s else: - return s.encode(sys.getfilesystemencoding(), 'ignore') + encoding = sys.getfilesystemencoding() + if encoding is None: + encoding = 'utf-8' + return s.encode(encoding, 'ignore') class ExtractorError(Exception):