Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
cant download from qq #6831
cant download from qq #6831
Comments
|
Only QQMusic is supported atm. |
|
From #9210: http://v.qq.com/cover/t/t1rmktedqbey1g5/d0020cv1s3t.html should be supported too. |
|
AFAIK the |
|
In what ways can download QQ video? |
|
Currently impossible with youtube-dl. |
the key can be extracted from the qq api, but it will take time because there will be many request to extract the keys for all parts of all formats, the problem is that handling the formats using |
I found a lib in git. it can get qq video info and key info. It looks like decomplier the QQ SWF player and write the algorithms by python.
so it tegrated into youtube-dl ? @yan12125 |
|
@loopArray This file is licensed under MIT, which is not compatible with youtube-dl's UNLICENSE. If you want to integrate it into youtube-dl, you need to ask its original author to re-license it to a compatible one, for example UNLICENSE or Public Domain. |
|
when I see the LICENSE is different, I almost had a nervous breakdown. is some way to solution the problem? as you know the qq is not allow we download him videos, but we continue download it any way. @yan12125 |
|
Either ask the original author (lvqier), or write another version. |
|
@yan12125 when i write an issue to the author lvqier, other repositories ykdl's author give me a other one, it can download qq videos. I have review the code and find the key is not required! its qq's bug or is really not required? now, i can download qq video by using ykdl, but I also think it's necessary integrate it into youtube-dl. do you have want to try?^_^ |
|
ykdl is licensed under MIT too. If you are going to copy & paste codes from ykdl, please ask for explicit permission. If you're going to write your own version, that's fine :) |
if you look in the code you will find in |
|
It's the ckey field, the ckey is calculated by pass params. but it looks like given null character string is well to get the key by |
may be it's only used in the flash player, i didn't see any reference to # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
float_or_none,
)
class QQIE(InfoExtractor):
_VALID_URL = r'https?://(?:.*\.)?qq\.com/.*?vid=(?P<id>[^&]+)'
def _real_extract(self, url):
vid = self._match_id(url)
def get_json(jsonp):
return self._search_regex(r'({.*})', jsonp, None)
video_data = self._download_json(
'http://h5vv.video.qq.com/getinfo', vid, transform_source=get_json, query={
'vid': vid,
'platform': 10201,
'otype': 'json',
# 'defn': 'mp4', # default value is mp4, possible values: sd, hd, shd, fhd
})
video_info = video_data['vl']['vi'][0]
title = video_info['ti']
filename = video_info['fn']
vkey = video_info['fvkey']
width = int_or_none(video_info.get('vw'))
height = int_or_none(video_info.get('vh'))
server_info = video_info['ul']['ui'][0]
base_url = server_info['url']
vt = server_info['vt']
info = {}
current_format = next(fi for fi in video_data['fl']['fi'] if fi['sl'] == 1)
parts = video_info.get('cl', {}).get('ci', [])
if parts:
entries = []
for index, p in enumerate(parts, 1):
part_filename = re.sub(r'(.*)\.(\w)', r'\1.%d.\2' % index, filename)
vkey = self._download_json('http://h5vv.video.qq.com/getkey', vid, transform_source=get_json, query={
'vid': vid,
'platform': 10201,
'otype': 'json',
'format': current_format['id'],
'filename': part_filename,
'vt': vt,
})['key']
entries.append({
'id': '%s_part%d' % (vid, index),
'format_id': current_format.get('name'),
'title': title,
'url': base_url + part_filename + '?vkey=' + vkey,
'duration': float_or_none(p.get('cd')),
'width': width,
'height': height,
})
info.update({
'_type': 'multi_video',
'entries': entries,
})
else:
info = {
'format_id': current_format.get('name'),
'url': base_url + filename + '?vkey=' + vkey,
'duration': float_or_none(video_info.get('td')),
'width': width,
'height': height,
}
info.update({
'id': vid,
'title': title,
})
return info |
|
I'd love to share my work, but is re-licensing the only way? |
Compatible licenses include UNLICENSE and CC0. For others, re-licensing is necessary. |
|
@yan12125 I have re-licensed my repository, please enjoy it. |
|
I guess you mean https://github.com/lvqier/crawlers? Much thanks for opening it up! |
|
@yan12125 My pleasure~ |
|
Now that @lvqier relicensed his work, is there any progress on this issue? |
|
Sorry for the delay. I got a WIP work based on @lvqier's script but it's far from complete yet: https://github.com/yan12125/youtube-dl/tree/wip-qq |
|
I find something interesting in @lvqier's work. In a function called "sanbox API", the remote server http://sandbox.xinfan.org/ returns something like this:
From the codes, seems this API is equivalent to a CModule function in Tencent's SWF. A concern is that some users may consider 3rd party API servers not trustworthy. @lvqier Is there a reason to use another API server rather than to implement the corresponding CModule function directly in Python, just like your earlier versions? |
|
@yan12125, I do not release my latest code to public because it will not work even if you have right ckey. Now server of Tencent is validating guid, which is generated randomly at the first time when you visit the site of QQ video. |
|
Hmm. Did you mean the PLAYER_GUID variable? Sounds like the cache system in youtube-dl can help. Note to myself: https://v.qq.com/x/page/i0137wt2799.html doesn't work with wip-qq. Seems I over-simplify codes in txsp.py Ref: soimort/you-get#1685 |
Hi
I tried:
Supported sites lists some qq sites as supported though.