human
Complete this python program:
def get_dl_data(song, mediatype='any'):
assistant
#Here is the Python program you requested.

    """Get filesize and metadata for all streams, return dict.
    """
    def mbsize(x):
        '    Return    size    in    MB.    '
        return str(int((x / (1024 ** 2))))
    p = util.get_pafy(song)
    dldata = []
    text = '    [Fetching    stream    info]    >'
    streamlist = [x for x in p.allstreams]
    if (mediatype == 'audio'):
        streamlist = [x for x in p.audiostreams]
    l = len(streamlist)
    for (n, stream) in enumerate(streamlist):
        sys.stdout.write(((((text + ('-' * n)) + '>') + ('    ' * ((l - n) - 1))) + '<\r'))
        sys.stdout.flush()
        try:
            size = mbsize(stream.get_filesize())
        except TypeError:
            util.dbg(((c.r + '---Error    getting    stream    size') + c.w))
            size = 0
        item = {'mediatype': stream.mediatype, 'size': size, 'ext': stream.extension, 'quality': stream.quality, 'notes': stream.notes, 'url': stream.url}
        dldata.append(item)
    screen.writestatus('')
    return (dldata, p)