Skip to content

Commit

Permalink
Fixed hash_url fieled regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragroth committed Jul 16, 2021
1 parent e3336ba commit 60c7b86
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 23 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
vk_messages.egg-info
vk_messages/__pycache__/
.idea/
45 changes: 23 additions & 22 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
from distutils.core import setup

setup(
name = 'vk_messages',
packages = ['vk_messages'],
license='MIT',
version = '0.2',
description = 'Custom library to pass messages API restriction',
author = 'Aragroth (Osiris)',
author_email = '[email protected]',
url = 'https://github.com/Aragroth/vk_messages/',
download_url = 'https://github.com/Aragroth/vk_messages/releases/tag/v_01',
keywords = ['API', 'PYTHON', 'VK'],
install_requires=[
'requests',
'bs4',
],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
name='vk_messages',
packages=['vk_messages'],
license='MIT',
version='1.3',
description='Custom library to pass messages API restriction',
author='Aragroth (Osiris)',
author_email='[email protected]',
url='https://github.com/Aragroth/vk_messages/',
download_url='https://github.com/Aragroth/vk_messages/releases/tag/v_01',
keywords=['API', 'PYTHON', 'VK'],
install_requires=[
'requests',
'bs4',
],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
)
2 changes: 1 addition & 1 deletion vk_messages/vk_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def two_factor_auth(self):
response = self.main_session.get(f'https://vk.com/login?act=authcheck',
cookies=self.main_session.cookies.get_dict())

hash_url = re.findall(r"\"hash\":\s{0,}\"(\S*)\"},", str(response.text))
hash_url = re.findall(r"Authcheck\.init\('([a-z_0-9]+)'", str(response.text))
if hash_url == []:
raise Exception_MessagesAPI('Invalid login data or wrong auth method', 'LoginError')
hash_url = hash_url[0]
Expand Down

0 comments on commit 60c7b86

Please sign in to comment.