How to use the ytmdl.cache.main function in ytmdl

To help you get started, we’ve selected a few ytmdl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github deepjyoti30 / ytmdl / ytmdl.py View on Github external
# Check if --setup is passed
    if args.setup:
        setupConfig.make_config()
        exit(0)

    # After this part song name is required
    if song_name is None:
        prepend.PREPEND(2)
        print("Please pass a song name. This is necessary",
              "to search metadata.")
        exit(1)

    if not args.nolocal:
        # Search for the song locally
        if not cache.main(song_name):
            return 0

    is_quiet = args.quiet
    url = args.url

    # If the url is passed then get the data
    if url is not None:
        data = []
        # Get video data from youtube
        temp_data = yt.scan_video(yt.get_href(url))
        data.append(temp_data)

        # link to dw the song
        link = url

        # In this case choice will be 0