Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

乐视视频无法输出json #4

Closed
wwqgtxx opened this issue Jun 25, 2016 · 10 comments
Closed

乐视视频无法输出json #4

wwqgtxx opened this issue Jun 25, 2016 · 10 comments
Assignees

Comments

@wwqgtxx
Copy link

wwqgtxx commented Jun 25, 2016

错误如下

@wwqgtxx
Copy link
Author

wwqgtxx commented Jun 25, 2016

D:\PYTHON\ykdl>@"C:\Program Files (x86)\LieYing\Plugin\PyRun.exe" --normal ykdl -i --json http://www.le.com/ptv/vplay/25047584.html {'url': 'http://www.le.com/ptv/vplay/25047584.html', 'title': '绝命卦师01', 'vid': '25047584', 'site': '乐视 (Letv)', 'streams': {'720p': {'container': 'm3u8', 'tmp': <tempfile._TemporaryFileWrapper object at 0x02FB18B0>, 'size': 0, 'video_profile': '720p', 'src': ['C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\tmpedu3y43p.m3u8']}, '1300': {'container': 'm3u8', 'tmp': <tempfile._TemporaryFileWrapper object at 0x02FB1A70>, 'size': 0, 'video_profile': '1300', 'src': ['C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\tmpitjzzrvt.m3u8']}, '1080p': {'container': 'm3u8', 'tmp': <tempfile._TemporaryFileWrapper object at 0x02FB1C70>, 'size': 0, 'video_profile': '1080p', 'src': ['C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\tmpj7kj6eom.m3u8']}, '1000': {'container': 'm3u8', 'tmp': <tempfile._TemporaryFileWrapper object at 0x02FB1F90>, 'size': 0, 'video_profile': '1000', 'src': ['C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\tmpqojbw16p.m3u8']}, '350': {'container': 'm3u8', 'tmp': <tempfile._TemporaryFileWrapper object at 0x02FB17F0>, 'size': 0, 'video_profile': '350', 'src': ['C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\tmpy1rgooa0.m3u8']}}} Traceback (most recent call last): File "C:\Program Files (x86)\LieYing\Plugin\Lib\runpy.py", line 170, in _run_module_as_main "__main__", mod_spec) File "C:\Program Files (x86)\LieYing\Plugin\Lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "ykdl\__main__.py", line 6, in <module> main() File "D:\PYTHON\ykdl\ykdl\__init__.py", line 47, in main m.download(u, args) File "D:\PYTHON\ykdl\ykdl\extractor.py", line 95, in download self.download_normal() File "D:\PYTHON\ykdl\ykdl\extractor.py", line 118, in download_normal print(json.dumps(self.jsonlize(), indent=4, sort_keys=True, ensure_ascii=False)) File "C:\Program Files (x86)\LieYing\Plugin\Lib\json\__init__.py", line 237, in dumps **kw).encode(obj) File "C:\Program Files (x86)\LieYing\Plugin\Lib\json\encoder.py", line 201, in encode chunks = list(chunks) File "C:\Program Files (x86)\LieYing\Plugin\Lib\json\encoder.py", line 429, in _iterencode yield from _iterencode_dict(o, _current_indent_level) File "C:\Program Files (x86)\LieYing\Plugin\Lib\json\encoder.py", line 403, in _iterencode_dict yield from chunks File "C:\Program Files (x86)\LieYing\Plugin\Lib\json\encoder.py", line 403, in _iterencode_dict yield from chunks File "C:\Program Files (x86)\LieYing\Plugin\Lib\json\encoder.py", line 403, in _iterencode_dict yield from chunks File "C:\Program Files (x86)\LieYing\Plugin\Lib\json\encoder.py", line 436, in _iterencode o = _default(o) File "C:\Program Files (x86)\LieYing\Plugin\Lib\json\encoder.py", line 180, in default raise TypeError(repr(o) + " is not JSON serializable") TypeError: <tempfile._TemporaryFileWrapper object at 0x02FB1F90> is not JSON serializable

@zhangn1985 zhangn1985 self-assigned this Jun 25, 2016
@zhangn1985
Copy link
Collaborator

zhangn1985 commented Jun 25, 2016

@wwqgtxx 修复这个问题比较简单,只是-json是为了做什么?

因为乐视的url输出是一个临时文件,程序退出后就会被删除的。(windows系统除外)

@zhangn1985
Copy link
Collaborator

追加一个fix: 5a9faad

@wwqgtxx
Copy link
Author

wwqgtxx commented Jun 25, 2016

为了我的这个项目
https://github.com/wwqgtxx/wwqLyParse

@zhangn1985
Copy link
Collaborator

希望能帮到你,如果你在使用ykdl时有任何需求,请不要客气。

@wwqgtxx
Copy link
Author

wwqgtxx commented Jun 25, 2016

大家一起共同努力,尽量方便大家下载视频

@wwqgtxx
Copy link
Author

wwqgtxx commented Jun 25, 2016

对了,这个1300 1000 350 是什么清晰度呀,能不能用用户能看得懂的方式显示一下

@zhangn1985
Copy link
Collaborator

乐视的flash player就这么写的, 你有什么建议吗?

另外,需要在json输出中把m3u8解析出来吗?

@zhangn1985
Copy link
Collaborator

解析m3u8,json会很长,因为m3u8的分段ts都差不多是3s一个。

@wwqgtxx
Copy link
Author

wwqgtxx commented Jun 25, 2016

要是能解析出来m3u8应该会稳定很多,要不然还要读取一次m3u8文件,增加不确定因素,那三个清晰度估计就是所谓的“极速”“标清”“高清”吧

zhangn1985 pushed a commit that referenced this issue Apr 27, 2018
for #4

Change-Id: I3f7619fb18b600e066ea4a209c94b5e23cfc5d8c
Signed-off-by: ykdl <zhangn1985@gmail.com>
zhangn1985 pushed a commit that referenced this issue Apr 27, 2018
for #4

Change-Id: I0ccd86ed8dbe48feccdaa35c5dcb072fa60ac112
Signed-off-by: ykdl <zhangn1985@gmail.com>
zhangn1985 pushed a commit that referenced this issue Apr 27, 2018
for #4

Signed-off-by: ykdl <zhangn1985@gmail.com>
zhangn1985 pushed a commit that referenced this issue Apr 27, 2018
for #4

Signed-off-by: ykdl <zhangn1985@gmail.com>
zhangn1985 pushed a commit that referenced this issue Apr 27, 2018
fix: #4

Signed-off-by: ykdl <zhangn1985@gmail.com>
zhangn1985 pushed a commit that referenced this issue Apr 27, 2018
for #4

Change-Id: I3f7619fb18b600e066ea4a209c94b5e23cfc5d8c
Signed-off-by: ykdl <zhangn1985@gmail.com>
zhangn1985 pushed a commit that referenced this issue Apr 27, 2018
for #4

Change-Id: I0ccd86ed8dbe48feccdaa35c5dcb072fa60ac112
Signed-off-by: ykdl <zhangn1985@gmail.com>
zhangn1985 pushed a commit that referenced this issue Apr 27, 2018
for #4

Signed-off-by: ykdl <zhangn1985@gmail.com>
zhangn1985 pushed a commit that referenced this issue Apr 27, 2018
for #4

Signed-off-by: ykdl <zhangn1985@gmail.com>
zhangn1985 pushed a commit that referenced this issue Apr 27, 2018
fix: #4

Signed-off-by: ykdl <zhangn1985@gmail.com>
zhangn1985 pushed a commit that referenced this issue Apr 27, 2018
for #4

Change-Id: I3f7619fb18b600e066ea4a209c94b5e23cfc5d8c
Signed-off-by: Zhang Ning <zhangn1985@gmail.com>
zhangn1985 pushed a commit that referenced this issue Apr 27, 2018
for #4

Change-Id: I0ccd86ed8dbe48feccdaa35c5dcb072fa60ac112
Signed-off-by: Zhang Ning <zhangn1985@gmail.com>
zhangn1985 pushed a commit that referenced this issue Apr 27, 2018
for #4

Signed-off-by: Zhang Ning <zhangn1985@gmail.com>
zhangn1985 pushed a commit that referenced this issue Apr 27, 2018
for #4

Signed-off-by: Zhang Ning <zhangn1985@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants