DrKain / scrape-youtube

A lightning fast package to scrape YouTube search results
MIT License
112 stars 30 forks source link

Convert subscriber count to number #41

Closed DrKain closed 3 years ago

DrKain commented 3 years ago

Is your feature request related to a problem? Please describe. The channel subscriber count is displayed as 381K instead in the search results. Some smaller channels will have the full number, IE: 127 This isn't a huge problem but it would be a nice feature to have.

Describe the solution you'd like The string should be converted to a number. This should be included along with the original value in the results.

1.2M -> 1200000
381K -> 381000 1.5K -> 1500

Additional context Example response:

{
    "id": "UC0hNui8bT7yV0Xb8w8YxjHw",
    "name": "Poets of the Fall (Official)",
    "link": "https://www.youtube.com/channel/UC0hNui8bT7yV0Xb8w8YxjHw",
    "verified": true,
    "thumbnail": "https://yt3.ggpht.com/ytc/AAUvwniodp2yJktm7UlbHChoA_yqHNDEAUUZlJOKj6Ltxw=s0?imgmax=0",
    "description": "Welcome to the official Poets of the Fall YouTube channel! Finnish rockers Poets of the Fall - singer Marko, guitarist Olli and ...",
    "videoCount": 98,
    "subscribers": "381K",
    "subscriberCount": 381000
}