twitter.archive: unescape stuff like </>
This commit is contained in:
parent
44a6b17ec3
commit
1e2fc3bec7
1 changed files with 10 additions and 2 deletions
|
@ -18,6 +18,7 @@ except ImportError as e:
|
||||||
|
|
||||||
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
import html
|
||||||
from ..core.common import Paths, datetime_aware
|
from ..core.common import Paths, datetime_aware
|
||||||
from ..core.error import Res
|
from ..core.error import Res
|
||||||
|
|
||||||
|
@ -72,7 +73,10 @@ class Tweet(NamedTuple):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def text(self) -> str:
|
def text(self) -> str:
|
||||||
return self.raw['full_text']
|
res = self.raw['full_text']
|
||||||
|
# replace stuff like </>
|
||||||
|
res = html.unescape(res)
|
||||||
|
return res
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def urls(self) -> List[str]:
|
def urls(self) -> List[str]:
|
||||||
|
@ -116,7 +120,11 @@ class Like(NamedTuple):
|
||||||
@property
|
@property
|
||||||
def text(self) -> Optional[str]:
|
def text(self) -> Optional[str]:
|
||||||
# ugh. I think none means that tweet was deleted?
|
# ugh. I think none means that tweet was deleted?
|
||||||
return self.raw.get('fullText')
|
res = self.raw.get('fullText')
|
||||||
|
if res is None:
|
||||||
|
return None
|
||||||
|
res = html.unescape(res)
|
||||||
|
return res
|
||||||
|
|
||||||
# TODO deprecate?
|
# TODO deprecate?
|
||||||
@property
|
@property
|
||||||
|
|
Loading…
Add table
Reference in a new issue