mirror of
https://github.com/bellingcat/snscrape.git
synced 2026-06-13 12:58:27 +03:00
Implementing changes
This commit is contained in:
@@ -347,11 +347,15 @@ class VKontakteUserScraper(snscrape.base.Scraper):
|
|||||||
if websites:
|
if websites:
|
||||||
kwargs['websites'] = websites
|
kwargs['websites'] = websites
|
||||||
|
|
||||||
def parse_num(s: str) -> int:
|
def parse_num(s: str) -> typing.Tuple[int, int]:
|
||||||
if s.endswith('K'):
|
if s.endswith('K'):
|
||||||
return int(s[:-1]) * 1000, 1000
|
return int(s[:-1]) * 1000, 1000
|
||||||
elif s.endswith('M'):
|
elif s.endswith('M'):
|
||||||
return int(float(s[:-1]) * 1000000), 1000000
|
baseNum = s[:-1]
|
||||||
|
precision = 1000000
|
||||||
|
if '.' in s:
|
||||||
|
precision //= (10 ** len(baseNum.split('.')[1]))
|
||||||
|
return int(float(baseNum) * 1000000), precision
|
||||||
else:
|
else:
|
||||||
return int(s.replace(',', '')), 1
|
return int(s.replace(',', '')), 1
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user