yutipy 2.2.5__py3-none-any.whl → 2.2.6__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.
Potentially problematic release.
This version of yutipy might be problematic. Click here for more details.
- yutipy/lastfm.py +5 -3
- {yutipy-2.2.5.dist-info → yutipy-2.2.6.dist-info}/METADATA +1 -1
- {yutipy-2.2.5.dist-info → yutipy-2.2.6.dist-info}/RECORD +7 -7
- {yutipy-2.2.5.dist-info → yutipy-2.2.6.dist-info}/WHEEL +1 -1
- {yutipy-2.2.5.dist-info → yutipy-2.2.6.dist-info}/entry_points.txt +0 -0
- {yutipy-2.2.5.dist-info → yutipy-2.2.6.dist-info}/licenses/LICENSE +0 -0
- {yutipy-2.2.5.dist-info → yutipy-2.2.6.dist-info}/top_level.txt +0 -0
yutipy/lastfm.py
CHANGED
|
@@ -2,6 +2,7 @@ __all__ = ["LastFm", "LastFmException"]
|
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
4
|
from dataclasses import asdict
|
|
5
|
+
from time import time
|
|
5
6
|
from pprint import pprint
|
|
6
7
|
from typing import Optional
|
|
7
8
|
|
|
@@ -140,7 +141,8 @@ class LastFm:
|
|
|
140
141
|
|
|
141
142
|
response_json = response.json()
|
|
142
143
|
result = response_json.get("recenttracks", {}).get("track", [])[0]
|
|
143
|
-
|
|
144
|
+
is_playing = result.get("@attr", {}).get("nowplaying", False)
|
|
145
|
+
if result and is_playing:
|
|
144
146
|
album_art = [
|
|
145
147
|
img.get("#text")
|
|
146
148
|
for img in result.get("image", [])
|
|
@@ -153,10 +155,10 @@ class LastFm:
|
|
|
153
155
|
separate_artists(result.get("artist", {}).get("#text"))
|
|
154
156
|
),
|
|
155
157
|
id=result.get("mbid"),
|
|
156
|
-
timestamp=result.get("date", {}).get("uts"),
|
|
158
|
+
timestamp=result.get("date", {}).get("uts") or time(),
|
|
157
159
|
title=result.get("name"),
|
|
158
160
|
url=result.get("url"),
|
|
159
|
-
is_playing=
|
|
161
|
+
is_playing=is_playing,
|
|
160
162
|
)
|
|
161
163
|
return None
|
|
162
164
|
|
|
@@ -3,7 +3,7 @@ yutipy/deezer.py,sha256=xI7ZDoPHES64_uRN4aYA-kj56V4tFU8xYkZYPXidl_I,11266
|
|
|
3
3
|
yutipy/exceptions.py,sha256=zz0XyyZr5xRcmRyw3hdTGaVRcwRn_RSYZdmwmuO0sEM,1379
|
|
4
4
|
yutipy/itunes.py,sha256=3YBLoWPhIx6ODE2G-msRppCHo0DNDGZADj-XvL_f5H0,7867
|
|
5
5
|
yutipy/kkbox.py,sha256=ZOIW8rQuiYEWmsXW3Dw9Q5mw71Jh_tMRAULvEgAuDew,19310
|
|
6
|
-
yutipy/lastfm.py,sha256=
|
|
6
|
+
yutipy/lastfm.py,sha256=MFQFi7w3-KSsV6MVFDSSwkbINlOEDazi2h_rib76wPw,5876
|
|
7
7
|
yutipy/logger.py,sha256=GyLBlfQZ6pLNJ5MbyQSvcD_PkxmFdX41DPq5aeG1z68,1316
|
|
8
8
|
yutipy/models.py,sha256=45M-bNHusaAan_Ta_E9DyvsWujsT-ivbJqIfy2-i3R8,2343
|
|
9
9
|
yutipy/musicyt.py,sha256=WKR4J4ru1uqNa7ORSZKlet1FxXQlHzlXTg9CIUqnsoc,9462
|
|
@@ -14,9 +14,9 @@ yutipy/cli/config.py,sha256=e5RIq6RxVxxzx30nKVMa06gwyQ258s7U0WA1xvJuR_0,4543
|
|
|
14
14
|
yutipy/cli/search.py,sha256=8SQw0bjRzRqAg-FuVz9aWjB2KBZqmCf38SyKAQ3rx5E,3025
|
|
15
15
|
yutipy/utils/__init__.py,sha256=AZaqvs6AJwnqwJuodbGnHu702WSUqc8plVC16SppOcU,239
|
|
16
16
|
yutipy/utils/helpers.py,sha256=W3g9iqoSygcFFCKCp2sk0NQrZOEG26wI2XuNi9pgAXE,5207
|
|
17
|
-
yutipy-2.2.
|
|
18
|
-
yutipy-2.2.
|
|
19
|
-
yutipy-2.2.
|
|
20
|
-
yutipy-2.2.
|
|
21
|
-
yutipy-2.2.
|
|
22
|
-
yutipy-2.2.
|
|
17
|
+
yutipy-2.2.6.dist-info/licenses/LICENSE,sha256=_89JsS2QnBG8tAb5-VWbJDj_uJ002zPJAYBJJdh3DPY,1071
|
|
18
|
+
yutipy-2.2.6.dist-info/METADATA,sha256=K2BV7ZPAsD1sxXGFCd6FELl8Bqev0-b5zBzwtpGkTw4,6522
|
|
19
|
+
yutipy-2.2.6.dist-info/WHEEL,sha256=ooBFpIzZCPdw3uqIQsOo4qqbA4ZRPxHnOH7peeONza0,91
|
|
20
|
+
yutipy-2.2.6.dist-info/entry_points.txt,sha256=BrgmanaPjQqKQ3Ip76JLcsPgGANtrBSURf5CNIxl1HA,106
|
|
21
|
+
yutipy-2.2.6.dist-info/top_level.txt,sha256=t2A5V2_mUcfnHkbCy6tAQlb3909jDYU5GQgXtA4756I,7
|
|
22
|
+
yutipy-2.2.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|