jaw20 / Crunchyroll-XML-Decoder

GNU General Public License v2.0
37 stars 14 forks source link

Problem choice resolution video #63

Open Virusf opened 5 years ago

Virusf commented 5 years ago

Hi people

someone would have a solution because the choice of resolution no longer works and whatever the choice the resolution is 1080p?

sorry for my english which is google translation

Elegond commented 5 years ago

i haven't looked at the selection of the resolution yet but crunchyroll doesn't send the resolution in the xml answer anymore since today.

Elegond commented 5 years ago

I think the quality in altfuncs.py line 20 needs to be remapped but I don't have the time to test it right now.

nigoki2 commented 5 years ago

Thank you Elegond. Now I have to find how to download in 720p.

rs3mk commented 5 years ago

you can extract quality from the link of the stream

resolution

example:

ffmpeg -i "https://dl.v.vrv......." -map p:0 -c copy "720p.ts" ffmpeg -i "https://dl.v.vrv......." -map p:1 -c copy "1080p.ts" ffmpeg -i "https://dl.v.vrv......." -map p:2 -c copy "480p.ts"

nigoki2 commented 5 years ago

@rs3mk How to put this in the script ?

rs3mk commented 5 years ago

edit: ultimate.py video_hls(filen, video_input, vquality) ultimate

hls.py

def find_720_video(uri, vquality):
    playlist = m3u8.load(uri)
    if not playlist.is_variant:
        return playlist
    best_stream = playlist.playlists[0]
    for stream in playlist.playlists:
        if stream.stream_info.bandwidth == 'max' or stream.stream_info.resolution == vquality:
            best_stream = stream
    return find_720_video(best_stream.absolute_uri, vquality)

def video_hls(uri, output, vquality):
    if vquality == "720p":
        vquality = "1280x720"
        video = find_720_video(uri, vquality)
        fetch_encryption_key(video)
        fetch_streams(output, video)    
    else:
        video = find_best_video(uri)
        fetch_encryption_key(video)
        fetch_streams(output, video)

hls

nigoki2 commented 5 years ago

@rs3mk Thanks for your help but it doesn't work with me. After editing ultimate.py and hls.py the script still downloads in 1080p.

alzamer2 commented 5 years ago

can you try this code https://github.com/alzamer2/Crunchyroll-XML-Decoder-py3 i re-write it to use python3