forked from MarseyWorld/MarseyWorld
grate
parent
80c954efdd
commit
5aa2c0e8c0
|
@ -231,10 +231,15 @@ class Submission(Base):
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def domain(self):
|
def domain(self):
|
||||||
|
print('1')
|
||||||
if not self.url: return None
|
if not self.url: return None
|
||||||
|
print('2')
|
||||||
if self.url.startswith('/'): return SITE
|
if self.url.startswith('/'): return SITE
|
||||||
|
print('3')
|
||||||
domain = urlparse(self.url).netloc
|
domain = urlparse(self.url).netloc
|
||||||
|
print('4')
|
||||||
if domain.startswith("www."): domain = domain.split("www.")[1]
|
if domain.startswith("www."): domain = domain.split("www.")[1]
|
||||||
|
print('5')
|
||||||
return domain.replace("old.reddit.com", "reddit.com")
|
return domain.replace("old.reddit.com", "reddit.com")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
Loading…
Reference in New Issue