udemy-userAPI 0.3.4__py3-none-any.whl → 0.3.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- udemy_userAPI/__version__.py +1 -1
- udemy_userAPI/api.py +8 -8
- udemy_userAPI/authenticate.py +7 -3
- udemy_userAPI/bultins.py +3 -3
- udemy_userAPI/sections.py +3 -3
- udemy_userAPI/udemy.py +1 -1
- {udemy_userAPI-0.3.4.dist-info → udemy_userAPI-0.3.5.dist-info}/METADATA +2 -2
- {udemy_userAPI-0.3.4.dist-info → udemy_userAPI-0.3.5.dist-info}/RECORD +11 -11
- {udemy_userAPI-0.3.4.dist-info → udemy_userAPI-0.3.5.dist-info}/LICENSE +0 -0
- {udemy_userAPI-0.3.4.dist-info → udemy_userAPI-0.3.5.dist-info}/WHEEL +0 -0
- {udemy_userAPI-0.3.4.dist-info → udemy_userAPI-0.3.5.dist-info}/top_level.txt +0 -0
udemy_userAPI/__version__.py
CHANGED
udemy_userAPI/api.py
CHANGED
@@ -66,7 +66,7 @@ def get_pssh(init_url):
|
|
66
66
|
from .authenticate import UdemyAuth
|
67
67
|
auth = UdemyAuth()
|
68
68
|
if not auth.verif_login():
|
69
|
-
raise LoginException("
|
69
|
+
raise LoginException("Sessão expirada!")
|
70
70
|
res = requests.get(init_url, headers=HEADERS_octet_stream)
|
71
71
|
if not res.ok:
|
72
72
|
return
|
@@ -134,7 +134,7 @@ def extract(pssh, license_token):
|
|
134
134
|
from .authenticate import UdemyAuth
|
135
135
|
auth = UdemyAuth()
|
136
136
|
if not auth.verif_login():
|
137
|
-
raise LoginException("
|
137
|
+
raise LoginException("Sessão expirada!")
|
138
138
|
license_url = (f"https://www.udemy.com/api-2.0/media-license-server/validate-auth-token?drm_type=widevine"
|
139
139
|
f"&auth_token={license_token}")
|
140
140
|
session_id = cdm.open()
|
@@ -163,7 +163,7 @@ def get_mpd_file(mpd_url):
|
|
163
163
|
from .authenticate import UdemyAuth
|
164
164
|
auth = UdemyAuth()
|
165
165
|
if not auth.verif_login():
|
166
|
-
raise LoginException("
|
166
|
+
raise LoginException("Sessão expirada!")
|
167
167
|
try:
|
168
168
|
# Faz a solicitação GET com os cabeçalhos
|
169
169
|
response = requests.get(mpd_url, headers=HEADERS_USER)
|
@@ -240,7 +240,7 @@ def get_add_files(course_id: int):
|
|
240
240
|
from .authenticate import UdemyAuth
|
241
241
|
auth = UdemyAuth()
|
242
242
|
if not auth.verif_login():
|
243
|
-
raise LoginException("
|
243
|
+
raise LoginException("Sessão expirada!")
|
244
244
|
url = (f'https://www.udemy.com/api-2.0/courses/{course_id}/subscriber-curriculum-items/?page_size=2000&fields['
|
245
245
|
f'lecture]=title,object_index,is_published,sort_order,created,asset,supplementary_assets,is_free&fields['
|
246
246
|
f'quiz]=title,object_index,is_published,sort_order,type&fields[practice]=title,object_index,is_published,'
|
@@ -312,7 +312,7 @@ def get_links(course_id: int, id_lecture: int):
|
|
312
312
|
from .authenticate import UdemyAuth
|
313
313
|
auth = UdemyAuth()
|
314
314
|
if not auth.verif_login():
|
315
|
-
raise LoginException("
|
315
|
+
raise LoginException("Sessão expirada!")
|
316
316
|
try:
|
317
317
|
# Faz a solicitação GET com os cabeçalhos
|
318
318
|
response = requests.get(get, headers=HEADERS_USER)
|
@@ -360,7 +360,7 @@ def get_external_liks(course_id: int, id_lecture, asset_id):
|
|
360
360
|
from .authenticate import UdemyAuth
|
361
361
|
auth = UdemyAuth()
|
362
362
|
if not auth.verif_login():
|
363
|
-
raise LoginException("
|
363
|
+
raise LoginException("Sessão expirada!")
|
364
364
|
url = (f'https://www.udemy.com/api-2.0/users/me/subscribed-courses/{course_id}/lectures/{id_lecture}/'
|
365
365
|
f'supplementary-assets/{asset_id}/?fields[asset]=external_url')
|
366
366
|
try:
|
@@ -561,7 +561,7 @@ def lecture_infor(course_id: int, id_lecture: int):
|
|
561
561
|
from .authenticate import UdemyAuth
|
562
562
|
auth = UdemyAuth()
|
563
563
|
if not auth.verif_login():
|
564
|
-
raise LoginException("
|
564
|
+
raise LoginException("Sessão expirada!")
|
565
565
|
edpoint = (f"https://www.udemy.com/api-2.0/users/me/subscribed-courses/{course_id}/lectures/{id_lecture}/?"
|
566
566
|
f"fields[asset]=media_license_token")
|
567
567
|
r = requests.get(edpoint, headers=HEADERS_USER)
|
@@ -592,7 +592,7 @@ def assets_infor(course_id: int, id_lecture: int, assets_id: int):
|
|
592
592
|
from .authenticate import UdemyAuth
|
593
593
|
auth = UdemyAuth()
|
594
594
|
if not auth.verif_login():
|
595
|
-
raise LoginException("
|
595
|
+
raise LoginException("Sessão expirada!")
|
596
596
|
endpoint = (f'https://www.udemy.com/api-2.0/assets/{assets_id}/?fields[asset]=@min,status,delayed_asset_message,'
|
597
597
|
f'processing_errors,body&course_id={course_id}&lecture_id={id_lecture}')
|
598
598
|
r = requests.get(endpoint, headers=HEADERS_USER)
|
udemy_userAPI/authenticate.py
CHANGED
@@ -89,7 +89,11 @@ class UdemyAuth:
|
|
89
89
|
return False
|
90
90
|
else:
|
91
91
|
if 'error: 111' in resp.text:
|
92
|
-
raise Upstreamconnecterror(message=
|
92
|
+
raise Upstreamconnecterror(message=
|
93
|
+
'Erro ao se comunicar com o servidor remoto!')
|
94
|
+
elif 'upstream connect error or disconnect/reset before headers. reset reason: connection timeout' in resp.text:
|
95
|
+
raise Upstreamconnecterror(""
|
96
|
+
"Ocorreu uma falha de tempo de resposta!")
|
93
97
|
else:
|
94
98
|
raise LoginException(f"Erro Ao obter login : {resp.text}")
|
95
99
|
except requests.ConnectionError as e:
|
@@ -116,7 +120,7 @@ class UdemyAuth:
|
|
116
120
|
"""
|
117
121
|
try:
|
118
122
|
if self.verif_login():
|
119
|
-
raise UserWarning("Atenção, você já possui uma
|
123
|
+
raise UserWarning("Atenção, você já possui uma Sessão válida!")
|
120
124
|
s = cloudscraper.create_scraper()
|
121
125
|
r = s.get(
|
122
126
|
"https://www.udemy.com/join/signup-popup/",
|
@@ -222,7 +226,7 @@ class UdemyAuth:
|
|
222
226
|
from .api import J
|
223
227
|
try:
|
224
228
|
if self.verif_login():
|
225
|
-
raise UserWarning("Atenção, você já possui uma
|
229
|
+
raise UserWarning("Atenção, você já possui uma Sessão válida!")
|
226
230
|
# Inicializa uma sessão com proteção contra Cloudflare
|
227
231
|
session = cloudscraper.create_scraper()
|
228
232
|
|
udemy_userAPI/bultins.py
CHANGED
@@ -76,7 +76,7 @@ class Files:
|
|
76
76
|
from .authenticate import UdemyAuth
|
77
77
|
auth = UdemyAuth()
|
78
78
|
if not auth.verif_login():
|
79
|
-
raise LoginException("
|
79
|
+
raise LoginException("Sessão expirada!")
|
80
80
|
download_urls = []
|
81
81
|
for files in self.__data:
|
82
82
|
lecture_id = files.get('lecture_id', None)
|
@@ -418,7 +418,7 @@ class Course:
|
|
418
418
|
|
419
419
|
for chapter in self.__data.values():
|
420
420
|
for index, video in enumerate(chapter.get('videos_in_chapter', [])):
|
421
|
-
section = f"{chapter.get('title_chapter')}" # Adicionar numeração da
|
421
|
+
section = f"{chapter.get('title_chapter')}" # Adicionar numeração da Sessão
|
422
422
|
title = video.get('video_title')
|
423
423
|
id_lecture = video.get('lecture_id')
|
424
424
|
id_asset = video.get('asset_id')
|
@@ -430,7 +430,7 @@ class Course:
|
|
430
430
|
'section_order': section_order
|
431
431
|
}
|
432
432
|
videos.append(dt)
|
433
|
-
section_order += 1 # Incrementar o número da
|
433
|
+
section_order += 1 # Incrementar o número da Sessão após processar os vídeos do capítulo
|
434
434
|
return videos
|
435
435
|
|
436
436
|
def get_details_lecture(self, lecture_id: int) -> Lecture:
|
udemy_userAPI/sections.py
CHANGED
@@ -12,7 +12,7 @@ def get_courses_plan(tipe: str) -> list:
|
|
12
12
|
from .authenticate import UdemyAuth
|
13
13
|
auth = UdemyAuth()
|
14
14
|
if not auth.verif_login():
|
15
|
-
raise LoginException("
|
15
|
+
raise LoginException("Sessão expirada!")
|
16
16
|
courses_data = []
|
17
17
|
if tipe == 'default':
|
18
18
|
response = requests.get(f"https://www.udemy.com/api-2.0/users/me/subscribed-courses/?page_size=1000"
|
@@ -69,7 +69,7 @@ def get_details_courses(course_id):
|
|
69
69
|
from .authenticate import UdemyAuth
|
70
70
|
auth = UdemyAuth()
|
71
71
|
if not auth.verif_login():
|
72
|
-
raise LoginException("
|
72
|
+
raise LoginException("Sessão expirada!")
|
73
73
|
response = requests.get(
|
74
74
|
f"https://www.udemy.com/api-2.0/courses/{course_id}/subscriber-curriculum-items/?"
|
75
75
|
f"caching_intent=True&fields%5Basset%5D=title%2Cfilename%2Casset_type%2Cstatus%2Ctime_estimation%2"
|
@@ -105,7 +105,7 @@ def get_course_infor(course_id):
|
|
105
105
|
from .authenticate import UdemyAuth
|
106
106
|
auth = UdemyAuth()
|
107
107
|
if not auth.verif_login():
|
108
|
-
raise LoginException("
|
108
|
+
raise LoginException("Sessão expirada!")
|
109
109
|
end_point = (
|
110
110
|
f'https://www.udemy.com/api-2.0/courses/{course_id}/?fields[course]=title,context_info,primary_category,'
|
111
111
|
'primary_subcategory,avg_rating_recent,visible_instructors,locale,estimated_content_length,'
|
udemy_userAPI/udemy.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: udemy_userAPI
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.5
|
4
4
|
Summary: Obtenha detalhes de cursos que o usuário esteja inscrito da plataforma Udemy,usando o EndPoint de usuário o mesmo que o navegador utiliza para acessar e redenrizar os cursos.
|
5
5
|
Author: PauloCesar-dev404
|
6
6
|
Author-email: paulocesar0073dev404@gmail.com
|
@@ -19,7 +19,7 @@ Requires-Dist: pywidevine
|
|
19
19
|
# udemy-userAPI
|
20
20
|
|
21
21
|
|
22
|
-

|
23
23
|

|
24
24
|
[](https://paulocesar-dev404.github.io/me-apoiando-online/)
|
25
25
|
[](https://github.com/PauloCesar-dev404/udemy-userAPI/blob/main/docs/iniciando.md)
|
@@ -11,19 +11,19 @@ m3u8_analyzer/__init__.py,sha256=v7CiVqsCq2YH347C-QR1kHPJtXFFdru8qole3E9adCY,217
|
|
11
11
|
m3u8_analyzer/__version__.py,sha256=YP3yT87ZKrU3eARUUdQ_pg4xAXLGfBXjH4ZgEoZSq1I,25
|
12
12
|
m3u8_analyzer/exeptions.py,sha256=fK6bU3YxNSbfsPmCp4yudUvmwy_g6dj2KwIkH0dW4LI,3672
|
13
13
|
udemy_userAPI/__init__.py,sha256=BPle89xE_CMTKKe_Lw6jioYLgpH-q_Lpho2S-n1PIUA,206
|
14
|
-
udemy_userAPI/__version__.py,sha256=
|
15
|
-
udemy_userAPI/api.py,sha256=
|
16
|
-
udemy_userAPI/authenticate.py,sha256=
|
17
|
-
udemy_userAPI/bultins.py,sha256=
|
14
|
+
udemy_userAPI/__version__.py,sha256=KF4FqN0B8354CyIinRZ2T7-t4ct6rTtcrMnH_iJeu4c,405
|
15
|
+
udemy_userAPI/api.py,sha256=oDVylMQ6CsMeJ7V7FKdjjjvY0GrHHqJdVMTTptQmSiE,24277
|
16
|
+
udemy_userAPI/authenticate.py,sha256=RZb8R4fjmXEZFn8-RgCEOiPVgc6KpUglR_NcN2lgxiM,14242
|
17
|
+
udemy_userAPI/bultins.py,sha256=HzLiGLfLPY_wGe9mHOHWcTRMJA5ssJ7lhFX-k6jG7qo,16428
|
18
18
|
udemy_userAPI/exeptions.py,sha256=kfnPdZpqYY8nd0gnl6_Vh-MIz-XupmmbRPIuFnyXupk,692
|
19
|
-
udemy_userAPI/sections.py,sha256=
|
20
|
-
udemy_userAPI/udemy.py,sha256=
|
19
|
+
udemy_userAPI/sections.py,sha256=oP3jvbsWocemqhzzOAOoeL7ICF1f4gNvjL4FJBt47pE,5474
|
20
|
+
udemy_userAPI/udemy.py,sha256=SpK0LI4hjO45nZDz5waw-Py-d0uulBb28TVjltyWBxM,2920
|
21
21
|
udemy_userAPI/.cache/.udemy_userAPI,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
22
22
|
udemy_userAPI/mpd_analyzer/__init__.py,sha256=i3JVWyvcFLaj5kPmx8c1PgjsLht7OUIQQClD4yqYbo8,102
|
23
23
|
udemy_userAPI/mpd_analyzer/bin.wvd,sha256=1rAJdCc120hQlX9qe5KUS628eY2ZHYxQSmyhGNefSzo,2956
|
24
24
|
udemy_userAPI/mpd_analyzer/mpd_parser.py,sha256=PgUkHc5x8FTuXFCuYkWPZr9TaO_nsKalb02EFYl_zeA,8926
|
25
|
-
udemy_userAPI-0.3.
|
26
|
-
udemy_userAPI-0.3.
|
27
|
-
udemy_userAPI-0.3.
|
28
|
-
udemy_userAPI-0.3.
|
29
|
-
udemy_userAPI-0.3.
|
25
|
+
udemy_userAPI-0.3.5.dist-info/LICENSE,sha256=l4jdKYt8gSdDFOGr09vCKnMn_Im55XIcQKqTDEtFfNs,1095
|
26
|
+
udemy_userAPI-0.3.5.dist-info/METADATA,sha256=o1owEF5J71y7GTa1Q9pBbaiVL4IRQ7LqWKyCRwUKABY,1438
|
27
|
+
udemy_userAPI-0.3.5.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
28
|
+
udemy_userAPI-0.3.5.dist-info/top_level.txt,sha256=ijTINaSDRKhdahY_X7dmSRFTxBIwQErWv9ATCG55mog,14
|
29
|
+
udemy_userAPI-0.3.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|