diff --git a/README.md b/README.md index c84904f..a7d04df 100644 --- a/README.md +++ b/README.md @@ -75,10 +75,8 @@ API를 제공합니다. 다른 플러그인에서 동영상 정보나 다운로 `archive` | 다운로드한 동영상의 ID를 기록할 파일 경로. 파일이 이미 있으면 이미 다운로드한 동영상은 다운로드 하지 않음. 미지정 시 기록하지 않음 | X | String `start` | 다운로드 준비 후 바로 다운로드를 시작할지 여부. 기본값: `false` | X | Boolean `cookiefile` | 다운로드 시 필요한 쿠키 파일 경로 | X | String -`headers` | 다운로드 시 사용할 헤더. 기본값: `{}` | X | String -`dateafter` 키에 넣을 수 있는 날짜는 `YYYYMMDD` 또는 `(now|today)[+-][0-9](day|week|month|year)(s)?` 형식의 문자열입니다. -`headers` 키에 넣는 값은 `json` 형식의 문자열입니다. +`dateafter` 키에 넣을 수 있는 날짜는 `YYYYMMDD` 또는 `(now|today)[+-][0-9](day|week|month|year)(s)?` 형식의 문자열입니다. #### Response 키 | 설명 | 타입 --- | --- | --- @@ -135,6 +133,9 @@ API를 제공합니다. 다른 플러그인에서 동영상 정보나 다운로 물론 해당 정보가 없으면 null입니다. ## Changelog +v2.2.0 +* download API의 headers 키 제거 + v2.1.2 * youtube-dlc 호환 문제 수정 diff --git a/info.json b/info.json index 003f388..5a7a43f 100644 --- a/info.json +++ b/info.json @@ -1 +1 @@ -{"description": "\uc720\ud29c\ube0c, \ub124\uc774\ubc84TV \ub4f1 \ub3d9\uc601\uc0c1 \uc0ac\uc774\ud2b8\uc5d0\uc11c \ub3d9\uc601\uc0c1 \ub2e4\uc6b4\ub85c\ub4dc", "name": "youtube-dl", "more": "", "version": "2.1.2", "home": "https://github.com/joyfuI/youtube-dl", "category_name": "vod", "developer": "joyfuI"} \ No newline at end of file +{"description": "\uc720\ud29c\ube0c, \ub124\uc774\ubc84TV \ub4f1 \ub3d9\uc601\uc0c1 \uc0ac\uc774\ud2b8\uc5d0\uc11c \ub3d9\uc601\uc0c1 \ub2e4\uc6b4\ub85c\ub4dc", "name": "youtube-dl", "more": "", "version": "2.2.0", "home": "https://github.com/joyfuI/youtube-dl", "category_name": "vod", "developer": "joyfuI"} \ No newline at end of file diff --git a/logic_normal.py b/logic_normal.py index da16bb2..c8267f9 100644 --- a/logic_normal.py +++ b/logic_normal.py @@ -113,8 +113,7 @@ class LogicNormal(object): if 'cookiefile' in kwagrs and kwagrs['cookiefile']: opts['cookiefile'] = kwagrs['cookiefile'] dateafter = kwagrs.get('dateafter') - headers = kwagrs.get('headers', {}) - youtube_dl = MyYoutubeDL(plugin, url, filename, temp_path, save_path, opts, dateafter, headers=headers) + youtube_dl = MyYoutubeDL(plugin, url, filename, temp_path, save_path, opts, dateafter) youtube_dl.key = kwagrs.get('key') LogicNormal.youtube_dl_list.append(youtube_dl) # 리스트 추가 return youtube_dl diff --git a/my_youtube_dl.py b/my_youtube_dl.py index 23617ac..381e913 100644 --- a/my_youtube_dl.py +++ b/my_youtube_dl.py @@ -45,7 +45,7 @@ class MyYoutubeDL(object): __index = 0 _last_msg = '' - def __init__(self, plugin, url, filename, temp_path, save_path=None, opts=None, dateafter=None, datebefore=None, headers={}): + def __init__(self, plugin, url, filename, temp_path, save_path=None, opts=None, dateafter=None, datebefore=None): # from youtube_dl.utils import DateRange from .plugin import YOUTUBE_DL_PACKAGE DateRange = __import__('%s.utils' % YOUTUBE_DL_PACKAGE, fromlist=['DateRange']).DateRange @@ -66,7 +66,6 @@ class MyYoutubeDL(object): self.opts = opts if dateafter or datebefore: self.opts['daterange'] = DateRange(start=dateafter, end=datebefore) - self.headers = headers self.index = MyYoutubeDL.__index MyYoutubeDL.__index += 1 self.__status = Status.READY @@ -110,8 +109,6 @@ class MyYoutubeDL(object): try: self.start_time = datetime.now() self.status = Status.START - # headers는 전역으로 계속 사용하기 때문에 매번 세팅 - youtube_dl.utils.std_headers = self.headers # 동영상 정보 가져오기 info_dict = MyYoutubeDL.get_info_dict(self.url, self.opts.get('proxy'), self.opts.get('cookiefile')) if info_dict is None: diff --git a/plugin.py b/plugin.py index 39a3807..1801648 100644 --- a/plugin.py +++ b/plugin.py @@ -45,7 +45,7 @@ menu = { } plugin_info = { - 'version': '2.1.2', + 'version': '2.2.0', 'name': 'youtube-dl', 'category_name': 'vod', 'developer': 'joyfuI', @@ -211,7 +211,6 @@ def api(sub): archive = request.values.get('archive', None) start = request.values.get('start', False) cookiefile = request.values.get('cookiefile', None) - headers = request.values.get('headers', '{}') ret = { 'errorCode': 0, 'index': None @@ -238,9 +237,7 @@ def api(sub): proxy=ModelSetting.get('proxy'), ffmpeg_path=ModelSetting.get('ffmpeg_path'), key=key, - cookiefile=cookiefile, - # header는 json.dumps로 넘어오는 것으로 함. unqoute 등을 해야하는지 고려해야 함 - headers=json.loads(headers)) + cookiefile=cookiefile) if youtube_dl is None: return LogicNormal.abort(ret, 10) # 실패 ret['index'] = youtube_dl.index