Add constructor for User class
This was causing issues where appending to any of the lists would update the class variable rather than the instance variable, leading to everyone having the same likes, tracks, etc.
This commit is contained in:
parent
9e9a56386f
commit
0c496ecd71
15
scrape.py
15
scrape.py
@ -48,11 +48,18 @@ class User:
|
|||||||
following_count = None
|
following_count = None
|
||||||
follower_count = None
|
follower_count = None
|
||||||
|
|
||||||
tracks = []
|
tracks = None
|
||||||
likes = []
|
likes = None
|
||||||
|
|
||||||
followers = []
|
followers = None
|
||||||
following = []
|
following = None
|
||||||
|
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.tracks = []
|
||||||
|
self.likes = []
|
||||||
|
self.followers = []
|
||||||
|
self.following = []
|
||||||
|
|
||||||
class Track:
|
class Track:
|
||||||
url = ''
|
url = ''
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user