Skip to content

No Filter Selected Error #156

@axiinyaa

Description

@axiinyaa

Code:

        search_ : pyyoutube.SearchListResponse = youtube.search_by_keywords(q = content)
        tracks = []
        
        for result in list(search_.items):

            video : pyyoutube.VideoListResponse = youtube.get_video_by_id(video_id=result.id.videoId).items[0].snippet
            
            song_name = video.title
            artists = video.channelTitle
            url = video.thumbnails.standard.url

Traceback:

Traceback (most recent call last):
  File "C:\Python311\Lib\site-packages\interactions\client\models\command.py", line 907, in wrapper
    return await coro(self.extension, ctx, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Axolp\OneDrive\Documents\GitHub\JimBit\Commands\music.py", line 882, in autocomplete
    items = await self.load_spotify_search(text)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Axolp\OneDrive\Documents\GitHub\JimBit\Commands\music.py", line 337, in load_spotify_search
    video : pyyoutube.VideoListResponse = youtube.get_video_by_id(video_id=result.id.videoId).items[0].snippet
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\pyyoutube\api.py", line 2338, in get_video_by_id
    data = self._parse_response(resp)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\pyyoutube\api.py", line 327, in _parse_response
    raise PyYouTubeException(response)
pyyoutube.error.PyYouTubeException: YouTubeException(status_code=400,message=No filter selected. Expected one of: id, myRating, chart)
Invalid Form Body

I don't know what i'm doing wrong here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions