Russell-Newton / TikTokPy

Extract data from TikTok without needing any login information or API keys.
https://pypi.org/project/tiktokapipy/
MIT License
192 stars 24 forks source link

Need Parse the Transcript of a video #70

Closed zakrian07 closed 8 months ago

zakrian07 commented 11 months ago

https://www.tiktok.com/@lacedmedia/video/7265345807103085866 i want scrap the transcript of this video i found your api is not providing any support although how can i scrap full html until feature release can i parse this manually from html response

zakrian07 commented 11 months ago

@Russell-Newton any update on this

Russell-Newton commented 11 months ago

I have not had a chance to look at implementing this. I tried to do it a while ago but had some trouble. I'll take a look at it when I can, my priority is currently getting ready to go back to college. At the moment, there's no easy way to grab the HTML with this library, unfortunately.

zakrian07 commented 11 months ago

@Russell-Newton i have done a workaroung this api not pull subtitle info def download_subtitles_file(subtitle_url): print('Fetching video data ... ')

try:
    response = requests.get(subtitle_url, proxies={'http':'brd-customer-hl_13b9cb8c-zone-data_center:2b153vd2vt20@brd.superproxy.io:22225'}) 
    response.raise_for_status()

    print('Subtitles downloaded successfully!')

    subs = response.text
    subs = subs.replace('\n\d\d:\d\d:\d\d.\d\d\d --> \d\d:\d\d:\d\d.\d\d\d\n', '\n')
    subs = subs.replace('\n\n', '\n')
    subs = subs.replace('WEBVTT', '')

    return subs
except requests.HTTPError as http_err:
    print(f'HTTP error occurred: {http_err}')
    return {"error": True, "message": str(http_err)}
except Exception as err:
    print(f'Error occurred: {err}')
    return {"error": True, "message": str(err)}   subtitle_url = data['video']['subtitleInfos'][0]['Url']   
  download_subtitles_file(subtitle_url) fix the subtitle info its coming empty
zakrian07 commented 11 months ago

are we able to fix the subtitle issue ?

zakrian07 commented 8 months ago

@Russell-Newton bro i done it and fix many more things please tell me how to become contributor where can i share changelog

Russell-Newton commented 8 months ago

@zakrian07 make a fork with your changes if you haven't already, then create a pull request from your fork to this repo. I appreciate any contributions, especially because I've been pretty much unable to work on this library since starting grad school.

zakrian07 commented 8 months ago

I can share file source here you can review and merge then ?

On Sat, Nov 18, 2023 at 8:05 PM Russell Newton @.***> wrote:

@zakrian07 https://github.com/zakrian07 make a fork with your changes if you haven't already, then create a pull request from your fork to this repo. I appreciate any contributions, especially because I've been pretty much unable to work on this library since starting grad school.

— Reply to this email directly, view it on GitHub https://github.com/Russell-Newton/TikTokPy/issues/70#issuecomment-1817532474, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPI5XK6BJGRNIVSY6BYASDYFDFEVAVCNFSM6AAAAAA3L4HDCSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJXGUZTENBXGQ . You are receiving this because you were mentioned.Message ID: @.***>

Russell-Newton commented 8 months ago

Please create a fork and pull request. Here's a short guide from GitHub on how to do that: https://docs.github.com/en/get-started/quickstart/contributing-to-projects

zakrian07 commented 8 months ago

@Russell-Newton pull request done

Russell-Newton commented 8 months ago

Implemented in version 0.2.4.