R
Railway14mo ago
x4zx

Using yt-dlp to extract information

As far as I remember before when trying to use yt-dlp in a project - an error immediately appeared at the build stage. I would like to clarify this point now, as yt-dlp doesn't seem to violate the usage rules and it is not in https://railway.app/legal/fair-use. So I'd like to ask if it's possible to use it in projects now, I'll tell you up front - I need it for extracting information from tiktok videos, it will be something like that:
import yt_dlp

def get_tiktok(url):
ydl_opts = {'quiet': True, 'extract_flat': True}
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
info_dict = ydl.extract_info(url, download=False)
print(info_dict)

video_url = 'url to video'
get_tiktok(video_url)
import yt_dlp

def get_tiktok(url):
ydl_opts = {'quiet': True, 'extract_flat': True}
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
info_dict = ydl.extract_info(url, download=False)
print(info_dict)

video_url = 'url to video'
get_tiktok(video_url)
Solution:
well given the fact I don't work for Railway I have no real power here, I am just telling you the facts, you are free to do what you want, just know people have been banned for similar things
Jump to solution
16 Replies
Percy
Percy14mo ago
Project ID: N/A
x4zx
x4zxOP14mo ago
Also if the use of yt-dlp is still forbidden. Maybe someone knows an alternative solution
Brody
Brody14mo ago
even thought you aren't using it to download videos, it would still count as crawling or scraping, and in this instance, it wouldn't be allowed since your use of yt-dlp could hinder people who are using official APIs
x4zx
x4zxOP14mo ago
I take it you are referring to the official TikTok API? But how can yt-dlp interfere with them? It turns out that even collecting information on hosting is forbidden - after all, scrapers are often used for this purpose
Brody
Brody14mo ago
you can't, that's why it's not allowed, it doesn't use official APIs
x4zx
x4zxOP14mo ago
Do you know of any alternatives? It just turns out that all unofficial APIs cannot be used on hosting Scrapers implemented with bs4 I take it are also forbidden?
Brody
Brody14mo ago
does tick-tock have an official api
x4zx
x4zxOP14mo ago
It's there, it's just hard to access it.
Brody
Brody14mo ago
that doesn't sound very official then
x4zx
x4zxOP14mo ago
But as for me you have too much faith in the honesty of people, I am sure that on your hosting thousands of projects in which there are scrapers
Brody
Brody14mo ago
there's zero people hosting scrappers on my platform
x4zx
x4zxOP14mo ago
you can see for yourself https://developers.tiktok.com/doc/display-api-overview/ to get access you have to create your own application, then verify it. Too many unnecessary steps
Brody
Brody14mo ago
that seems totally reasonable
x4zx
x4zxOP14mo ago
And after all that, you get very limited functionality
Solution
Brody
Brody14mo ago
well given the fact I don't work for Railway I have no real power here, I am just telling you the facts, you are free to do what you want, just know people have been banned for similar things
x4zx
x4zxOP14mo ago
got it, thank you
Want results from more Discord servers?
Add your server