-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor sms_services module to centralize SMS service instance retri…
…eval
- Loading branch information
1 parent
206b7b3
commit f9e57b3
Showing
4 changed files
with
43 additions
and
31 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
ninjemail/captcha_solvers/capsolver-chrome-extension/assets/config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from sms_services import getsmscode | ||
from sms_services import smspool | ||
from sms_services import fivesim | ||
|
||
def get_sms_instance(sms_info, email_provider): | ||
""" | ||
Retrieves an instance of an SMS provider based on the given SMS information. | ||
Args: | ||
sms_info (dict): A dictionary containing the SMS service name and associated data. | ||
Returns: | ||
object: An instance of the SMS provider based on the provided SMS service. | ||
""" | ||
service_name = sms_info['name'] | ||
|
||
if service_name == 'getsmscode': | ||
data = sms_info['data'] | ||
project = 1 | ||
if email_provider == 'yahoo': | ||
project = 15 | ||
data.update({'project': project, 'country': 'us'}) | ||
sms_provider = getsmscode.GetsmsCode(**data) | ||
elif service_name == 'smspool': | ||
data = sms_info['data'] | ||
service = 395 | ||
if email_provider == 'yahoo': | ||
service = 1034 | ||
data.update({'service': service}) | ||
sms_provider = smspool.SMSPool(**data) | ||
elif service_name == '5sim': | ||
data = sms_info['data'] | ||
data.update({'service': email_provider}) | ||
sms_provider = fivesim.FiveSim(**data) | ||
|
||
print(data) | ||
|
||
return sms_provider |