faker
faker copied to clipboard
Faker Video Module
Clear and concise description of the problem
As a developer, I generally have video data of some sort -- using faker for generating video data (i.e. a URL to a hosted video, similar to how y'all do images) would be useful for populating my database with test video data.
Suggested solution
My idea for this looked something like this:
faker.video.animal() // returns a URL to a video of an animal
Usage would be exactly the same as the image module but for videos. I know y'all use Loremflickr for images but I'm not too sure if a video alternative exists.
Alternative
Right now, I hardcode a single video to use throughout the app for testing -- it works fine, but more diverse video sets would be nicer.
Additional context
No response
I don't think this is going to be stable, video can be removed
- Do you know of a website that provides these?
- Which video formats do you need?
Do you know of a website that provides these?
- Which video formats do you need?
- I do not know of a website that could do that
- MP4 would probably suffice since that generally tends to be the most common format
I don't think this is going to be stable, the video can be removed
there were any video modules? It could get random video URLs from youtube or any other service.
Thank you for your feature proposal.
We marked it as "waiting for user interest" for now to gather some feedback from our community:
- If you would like to see this feature be implemented, please react to the description with an up-vote (:+1:).
- If you have a suggestion or want to point out some special cases that need to be considered, please leave a comment, so we are aware about them.
We would also like to hear about other community members' use cases for the feature to give us a better understanding of their potential implicit or explicit requirements.
We will start the implementation based on:
- the number of votes (:+1:) and comments
- the relevance for the ecosystem
- availability of alternatives and workarounds
- and the complexity of the requested feature
We do this because:
- There are plenty of languages/countries out there and we would like to ensure that every method can cover all or almost all of them.
- Every feature we add to faker has "costs" associated to it:
- initial costs: design, implementation, reviews, documentation
- running costs: awareness of the feature itself, more complex module structure, increased bundle size, more work during refactors
Does anyone have any alternatives for this? Are there are any services like https://loremflickr.com but for videos?
Hi @musjj @SalahAdDin just play around with the video IDs.
The amount intermittent issues that will be introduced is not worth, and images works fine with base64 or ipfs services, so this is unlikely to be feasible except Faker team want to upload those videos for us which I believe not.
Current workaround is to get available videos video ID and make your own utility for it.
function getRandomYouTubeVideoUrl() {
const videos = [
"dQw4w9WgXcQ", // Rick Astley - Never Gonna Give You Up
"9bZkp7q19f0", // PSY - GANGNAM STYLE
"3JZ_D3ELwOQ", // Maroon 5 - Sugar
"e-ORhEE9VVg", // Ed Sheeran - Shape of You
"RgKAFK5djSk", // Wiz Khalifa - See You Again ft. Charlie Puth
"kXYiU_JCYtU", // Linkin Park - Numb
"kJQP7kiw5Fk", // Luis Fonsi - Despacito ft. Daddy Yankee
"fJ9rUzIMcZQ", // Queen - Bohemian Rhapsody
"CevxZvSJLk8", // Katy Perry - Roar
"60ItHLz5WEA", // Eminem - Without Me
];
const randomIndex = Math.floor(Math.random() * videos.length);
const randomVideoId = videos[randomIndex];
return `https://www.youtube.com/watch?v=${randomVideoId}`;
}
const randomVideoUrl = getRandomYouTubeVideoUrl();
console.log(randomVideoUrl);
If you want this video (please click), then just put the video id to the array.
And also use different services for videos to put in the array will decrease reliability, we will like to trust one service for the videos, in my head now is Youtube.
Use AI to generate those available video IDs, that is unbelievable works!
function getRandomYouTubeVideoUrl() {
const videos = [
"dQw4w9WgXcQ", // Rick Astley - Never Gonna Give You Up
"9bZkp7q19f0", // PSY - GANGNAM STYLE
"3JZ_D3ELwOQ", // Maroon 5 - Sugar
"e-ORhEE9VVg", // Ed Sheeran - Shape of You
"RgKAFK5djSk", // Wiz Khalifa - See You Again ft. Charlie Puth
"kXYiU_JCYtU", // Linkin Park - Numb
"kJQP7kiw5Fk", // Luis Fonsi - Despacito ft. Daddy Yankee
"fJ9rUzIMcZQ", // Queen - Bohemian Rhapsody
"CevxZvSJLk8", // Katy Perry - Roar
"60ItHLz5WEA", // Eminem - Without Me
];
const randomVideoId = faker.helpers.arrayElement(videos);
return `https://www.youtube.com/watch?v=${randomVideoId}`;
}
You can use the faker.helpers.arrayElement
helper function so you can take advantage of fakers seeding logic etc for reproducible results.
Hi @musjj @SalahAdDin just play around with the video IDs.
The amount intermittent issues that will be introduced is not worth, and images works fine with base64 or ipfs services, so this is unlikely to be feasible except Faker team want to upload those videos for us which I believe not.
Current workaround is to get available videos video ID and make your own utility for it.
function getRandomYouTubeVideoUrl() { const videos = [ "dQw4w9WgXcQ", // Rick Astley - Never Gonna Give You Up "9bZkp7q19f0", // PSY - GANGNAM STYLE "3JZ_D3ELwOQ", // Maroon 5 - Sugar "e-ORhEE9VVg", // Ed Sheeran - Shape of You "RgKAFK5djSk", // Wiz Khalifa - See You Again ft. Charlie Puth "kXYiU_JCYtU", // Linkin Park - Numb "kJQP7kiw5Fk", // Luis Fonsi - Despacito ft. Daddy Yankee "fJ9rUzIMcZQ", // Queen - Bohemian Rhapsody "CevxZvSJLk8", // Katy Perry - Roar "60ItHLz5WEA", // Eminem - Without Me ]; const randomIndex = Math.floor(Math.random() * videos.length); const randomVideoId = videos[randomIndex]; return `https://www.youtube.com/watch?v=${randomVideoId}`; } const randomVideoUrl = getRandomYouTubeVideoUrl(); console.log(randomVideoUrl);
If you want this video (please click), then just put the video id to the array.
And also use different services for videos to put in the array will decrease reliability, we will like to trust one service for the videos, in my head now is Youtube.
Pretty nice idea!
Thanks, I also found this gist for those who need direct video URLs instead of YouTube links: https://gist.github.com/aguilarcarlos/6fdb4b417285666246171d6320f70fb6 Not a lot, but enough to get started.