Skip to content

Commit

Permalink
fix: ~all
Browse files Browse the repository at this point in the history
  • Loading branch information
krypton-byte committed Apr 30, 2023
1 parent d563ea5 commit 58ac735
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
5 changes: 3 additions & 2 deletions tiktok_downloader/mdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ def __init__(self) -> None:
}

async def get_media(self, url: str):
bs = BeautifulSoup((
await self.get(self.BASE_URL + 'en/')).text, 'html.parser')
html = (await self.get(self.BASE_URL, follow_redirects=True))
bs = BeautifulSoup(
html.text, 'html.parser')
form = {
i['name']: i['value'] for i in bs.find_all(
'input',
Expand Down
2 changes: 1 addition & 1 deletion tiktok_downloader/snaptik.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ async def get_media(self) -> list[DownloadAsync]:
```
'''
resp = await self.get(
'https://snaptik.app/abc.php',
'https://snaptik.app/abc2.php',
params={
'url': self.tiktok_url,
'lang': 'en',
Expand Down
14 changes: 5 additions & 9 deletions tiktok_downloader/ssstik.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@

class SsstikIO(Session):
def get_media(self, url: str) -> list[Download]:
self.get('https://ssstik.io')
ses = self.get('https://ssstik.io')
resp = self.post(
'https://ssstik.io/abc?url=dl', data={
'id': url,
'locale': 'id',
'gc': 0,
'tt': 0,
'ts': 0
'locale': 'en',
'tt': re.findall(r'tt:\'([\w\d]+)\'', ses.text)[0],
},
headers={
'hx-current-url': 'https://ssstik.io/id',
Expand Down Expand Up @@ -47,14 +45,12 @@ def get_media(self, url: str) -> list[Download]:

class SsstikAIO(AsyncClient):
async def get_media(self, url: str):
await self.get('https://ssstik.io')
ses = await self.get('https://ssstik.io', follow_redirects=True)
resp = await self.post(
'https://ssstik.io/abc?url=dl', data={
'id': url,
'locale': 'id',
'gc': 0,
'tt': 0,
'ts': 0
'tt': re.findall(r'tt:\'([\w\d]+)\'', ses.text)[0],
},
headers={
'hx-current-url': 'https://ssstik.io/id',
Expand Down
2 changes: 1 addition & 1 deletion tiktok_downloader/tikmate.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def get_media(self, url: str) -> list[Download]:
]


class tikmateAsync(AsyncClient):
class TikmateAsync(AsyncClient):
BASE_URL = 'https://tikmate.online/'

def __init__(self) -> None:
Expand Down
7 changes: 4 additions & 3 deletions tiktok_downloader/ttdownloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,12 @@ def __init__(self, url: str) -> None:
self.url = url

async def get_media(self) -> list[DownloadAsync]:
indexsource = await self.get(self.BASE_URL)
indexsource = await self.get(self.BASE_URL, follow_redirects=True)
token = re.findall(r'value=\"([0-9a-z]+)\"', indexsource.text)
result = await self.post(
self.BASE_URL+'query/',
data={'url': self.url, 'format': '', 'token': token[0]}
self.BASE_URL+'search/',
data={'url': self.url, 'format': '', 'token': token[0]},
follow_redirects=True
)
nowm, wm, audio = re.findall(
r'(https?://.*?.php\?v\=.*?)\"', result.text
Expand Down

1 comment on commit 58ac735

@vercel
Copy link

@vercel vercel bot commented on 58ac735 Apr 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.