-
Notifications
You must be signed in to change notification settings - Fork 26
Login procedure change and bugs fixing #3
base: main
Are you sure you want to change the base?
Changes from 1 commit
e12ca5c
ceea0fd
fbb4c90
c9f7eb7
b60a569
ab32c3c
bb309df
b0af5aa
cb6f73b
9fc9c50
b55755e
8dd2f2f
9434b94
20d4eac
f69c763
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,13 +6,14 @@ | |
| import resources.lib.utils as U | ||
| from xbmcgui import DialogProgress | ||
| from xbmc import executebuiltin | ||
| import xbmc | ||
| from xbmcplugin import SORT_METHOD_EPISODE, SORT_METHOD_DATE | ||
| import time | ||
| import urlquick | ||
| from .api import HotstarAPI | ||
| from .builder import Builder | ||
| from .contants import BASE_HEADERS, CONTENT_TYPE | ||
|
|
||
| import web_pdb | ||
|
|
||
| @Route.register | ||
| def root(plugin): | ||
|
|
@@ -69,16 +70,7 @@ def play_ext(plugin, contentId, partner=None): | |
|
|
||
| @Script.register | ||
| def login(plugin): | ||
| msg = "1. Go to [B]https://tv.hotstar.com[/B]\n2. Login with your hotstar account[CR]3. Enter the 4 digit code : " | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this dialog is necessary for login.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Previous method of login using login code is no longer working. That's why I have removed this. Now, I have used OTP based method. |
||
| pdialog = DialogProgress() | ||
| pdialog.create("Login", msg+"Loading...") | ||
| for code, i in api.doLogin(): | ||
| if pdialog.iscanceled() or i == 100: | ||
| break | ||
| else: | ||
| time.sleep(1) | ||
| pdialog.update(i, msg+"[B][UPPERCASE]%s[/UPPERCASE][/B]" % code) | ||
| pdialog.close() | ||
| api.doLogin() | ||
|
|
||
|
|
||
| @Script.register | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,16 +24,18 @@ def login_wrapper(*args, **kwargs): | |
| if db.get("token"): | ||
| return func(*args, **kwargs) | ||
| elif db.get("isGuest") is None: | ||
| db["token"] = guestToken() | ||
| token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJ1bV9hY2Nlc3MiLCJleHAiOjE2NjQ4NjI3MzIsImlhdCI6MTY2NDI1NzkzMiwiaXNzIjoiVFMiLCJqdGkiOiIxMzc5MTIzN2QxNTg0YjJiOGE5ZGNjMTFiMzg4YTcyZCIsInN1YiI6IntcImhJZFwiOlwiMDg0ZjE4NjdmODVlNGYxMDkwODdlODc2YWI4ZWIyYWVcIixcInBJZFwiOlwiZGIxYzFlN2Q2NmFhNDg1ZDg4MzdiOGRhNzAzZWUwOWFcIixcIm5hbWVcIjpcIkd1ZXN0IFVzZXJcIixcImlwXCI6XCIxMDMuMTcyLjg2LjExNFwiLFwiY291bnRyeUNvZGVcIjpcImluXCIsXCJjdXN0b21lclR5cGVcIjpcIm51XCIsXCJ0eXBlXCI6XCJndWVzdFwiLFwiaXNFbWFpbFZlcmlmaWVkXCI6ZmFsc2UsXCJpc1Bob25lVmVyaWZpZWRcIjpmYWxzZSxcImRldmljZUlkXCI6XCI5NTE5OWEwYi1jODVhLTQwNTUtYmE4MS1hZDcyNGUwNTk5MTNcIixcInByb2ZpbGVcIjpcIkFEVUxUXCIsXCJ2ZXJzaW9uXCI6XCJ2MlwiLFwic3Vic2NyaXB0aW9uc1wiOntcImluXCI6e319LFwiaXNzdWVkQXRcIjoxNjY0MjU3OTMyMDU1fSIsInZlcnNpb24iOiIxXzAifQ.MfG9sAeXaBRkQgqz_TpQDAEt5jvIm6mlrzuA3fgvngk' | ||
| db["token"] = token | ||
| # db["token"] = guestToken() | ||
| db["isGuest"] = True | ||
| db.flush() | ||
| return func(*args, **kwargs) | ||
| else: | ||
| # login require | ||
| Script.notify( | ||
| "Login Error", "Please login to watch this content") | ||
| executebuiltin( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is good way to directly provide login popup when content is not subscribed so user will not be confuse
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I have not subscribed then popup of login screen may be annoying. Just simple message could solve the purpose. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you pls provide the updated addon link for Hotstar 1.2.1? |
||
| "RunPlugin(plugin://plugin.video.botallen.hotstar/resources/lib/main/login/)") | ||
| "Login Error", "You need valid subscription to watch this content") | ||
| # executebuiltin( | ||
| # "RunPlugin(plugin://plugin.video.botallen.hotstar/resources/lib/main/login/)") | ||
| return False | ||
| return login_wrapper | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is use of this dependency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not required, just for debug purpose. I will remove it