Skip to content

Issue in the regex pattern in Video class #21

@xdityagr

Description

@xdityagr

I used aiotube recently and continuously got Attribute Error for a valid youtube id "kyAV-pzQwzU", and on further investigation i found that there is a problem with the regex pattern that is being used, the pattern does not consider "-" (hyphens) in it's logic and only considers alphanumeric characters.

pattern = re.compile('.be/(.*?)$|=(.*?)$|^(\w{11})$') # noqa, Line 20, video.py as well as stream.py & any other file where this pattern is used.

the correct pattern should be,
pattern = re.compile(r'.be/(.*?)$|=(.*?)$|^([\w\-]{11})$')

Hope this helps, would love to further support the development.
Thank you,
Aditya.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions