File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33## [ Unreleased]
44
5+ ## [ 0.0.20] - 2021-05-15
6+ * fixed email-to-username postprocessor bug
7+ * added yandex-username-to-email postprocessor
8+
59## [ 0.0.19] - 2021-05-12
610* non-json transforms
711* added Weibo and Trello
Original file line number Diff line number Diff line change 88 long_description = fh .read ()
99
1010setup (name = 'socid-extractor' ,
11- version = '0.0.19 ' ,
11+ version = '0.0.20 ' ,
1212 description = 'Extract accounts\' identifiers from personal pages on various platforms' ,
1313 long_description = long_description ,
1414 long_description_content_type = "text/markdown" ,
Original file line number Diff line number Diff line change 11from .main import extract , parse , parse_cookies , mutate_url
22
3- __version__ = '0.0.19 '
3+ __version__ = '0.0.20 '
44__title__ = 'socid_extractor'
55__package__ = 'socid_extractor'
66__author__ = 'soxoj'
Original file line number Diff line number Diff line change @@ -48,15 +48,15 @@ def process(self):
4848 return output
4949
5050
51- class Email :
51+ class EmailToUsername :
5252 def __init__ (self , data ):
5353 self .data = data
5454
5555 def process (self ):
5656 output = {}
5757
5858 for k , v in self .data .items ():
59- if v . startswith ( '[' ) or v . startswith ( "'" ) :
59+ if v [ 0 ] in "'[{ \" " :
6060 continue
6161 if 'email' in k and '@' in v :
6262 new_k = k + '_username'
@@ -66,4 +66,20 @@ def process(self):
6666 return output
6767
6868
69- POSTPROCESSORS = [Gravatar , Email ]
69+ class YandexUsernameToEmail :
70+ def __init__ (self , data ):
71+ self .data = data
72+
73+ def process (self ):
74+ output = {}
75+ email = None
76+
77+ if 'yandex_uid' in self .data or 'yandex_public_id' in self .data :
78+ if 'username' in self .data :
79+ email = self .data ['username' ] + '@yandex.ru'
80+ output ['email' ] = email
81+
82+ return output
83+
84+
85+ POSTPROCESSORS = [Gravatar , EmailToUsername , YandexUsernameToEmail ]
Original file line number Diff line number Diff line change @@ -269,10 +269,10 @@ def test_yandex_music_user_profile():
269269 assert info .get ('username' ) == 'pritisk'
270270 assert info .get ('name' ) == 'Юрий Притиск'
271271 assert info .get ('image' ) == 'https://avatars.mds.yandex.net/get-yapic/29310/gK74BTyv8LrLRT0mQFIR2xcWv8-1/islands-200'
272- assert info .get ('links' ) == '[]'
273272 assert info .get ('is_verified' ) == 'False'
274273 assert info .get ('liked_albums' ) == '0'
275274 assert info .get ('liked_artists' ) == '0'
275+ assert info .get ('email' ) == 'pritisk@yandex.ru'
276276
277277
278278@pytest .mark .skip (reason = "failed from github CI infra IPs" )
You can’t perform that action at this time.
0 commit comments