def METHOD_NAME(self, magnet_uri, destination_folder, timeout):
    import libtorrent
    params = libtorrent.parse_magnet_uri(magnet_uri)
    session = libtorrent.session()
    lt_version = [int(v) for v in libtorrent.version.split('.')]
    if lt_version > [0, 16, 13, 0] and lt_version < [1, 1, 3, 0]:
        # for some reason the info_hash needs to be bytes but it's a struct called sha1_hash
        params['info_hash'] = params['info_hash'].to_bytes()
    if lt_version < [1, 2]:
        # for versions < 1.2
        params['url'] = magnet_uri
    else:
        params.url = magnet_uri
    handle = session.add_torrent(params)
    logger.debug('Acquiring torrent metadata for magnet {}', magnet_uri)
    timeout_value = timeout
    while not handle.has_metadata():
        time.sleep(0.1)
        timeout_value -= 0.1
        if timeout_value <= 0:
            raise plugin.PluginError(f'Timed out after {timeout} seconds trying to magnetize')
    logger.debug('Metadata acquired')
    torrent_info = handle.get_torrent_info()
    torrent_file = libtorrent.create_torrent(torrent_info)
    torrent_path = pathscrub(
        os.path.join(destination_folder, torrent_info.name() + ".torrent")
    )
    with open(torrent_path, "wb") as f:
        f.write(libtorrent.bencode(torrent_file.generate()))
    logger.debug('Torrent file wrote to {}', torrent_path)
    return torrent_path