Skip to content

Commit a3a2108

Browse files
committed
Js2Py update
1 parent bbc2209 commit a3a2108

File tree

6 files changed

+7
-14
lines changed

6 files changed

+7
-14
lines changed

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ pyotp
66
lxml
77
webvtt-py
88
m3u8
9-
git+https://github.com/a-j-albert/Js2Py---supports-python-3.13
9+
Js2Py-3.13

requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ pyotp
55
lxml
66
webvtt-py
77
m3u8
8-
js2py; python_version < '3.12'
9-
git+https://github.com/a-j-albert/Js2Py---supports-python-3.13.git; python_version >= '3.12'
8+
Js2Py-3.13

setup.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import re
2-
from sys import version_info
32

43
from setuptools import setup
54

@@ -10,12 +9,6 @@
109
version = re.findall(r"__version__ = '(.+)'", f.read())[0]
1110

1211

13-
if version_info >= (3, 12, 0):
14-
js2py_version = 'js2py @ git+https://github.com/a-j-albert/Js2Py---supports-python-3.13.git'
15-
else:
16-
js2py_version = 'js2py'
17-
18-
1912
setup(
2013
name='twikit',
2114
version=version,
@@ -27,7 +20,7 @@
2720
'lxml',
2821
'webvtt-py',
2922
'm3u8',
30-
js2py_version
23+
'Js2Py-3.13'
3124
],
3225
python_requires='>=3.8',
3326
description='Twitter API wrapper for python with **no API key required**.',

twikit/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
A Python library for interacting with the Twitter API.
88
"""
99

10-
__version__ = '2.3.1'
10+
__version__ = '2.3.2'
1111

1212
import asyncio
1313
import os

twikit/client/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@ async def login(
399399
ui_metrics_response = solve_ui_metrics(
400400
await self._ui_metrics()
401401
)
402+
print(ui_metrics_response)
402403
else:
403404
ui_metrics_response = ''
404405

twikit/ui_metrics/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import re
22

3-
import js2py
3+
import js2py_
44

55
from .dom import MockDocument
66

@@ -15,7 +15,7 @@ def solve_ui_metrics(ui_metrics: str) -> str:
1515
inner_function = match.group(1)
1616
# Replace '==' with '===' to ensure proper object comparison in js2py
1717
inner_function = EQUAL_PATTERN.sub(r'\1===\2', inner_function)
18-
context = js2py.EvalJs()
18+
context = js2py_.EvalJs()
1919
context.document = MockDocument()
2020
function = 'function main()' + inner_function
2121
context.eval(function)

0 commit comments

Comments
 (0)