Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] Use themoviedb.org as source for download #58

Open
VampiricAlien opened this issue Oct 9, 2024 · 7 comments
Open

[Request] Use themoviedb.org as source for download #58

VampiricAlien opened this issue Oct 9, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@VampiricAlien
Copy link

First off, thank you for creating this!

Using an API key, themoviedb allows downloading of trailers. This can be a good source if Youtube is blocked or/also cuts down on converting as trailers are in x264.

https://developer.themoviedb.org/reference/movie-videos

@VampiricAlien VampiricAlien added the enhancement New feature or request label Oct 9, 2024
@nandyalu
Copy link
Owner

nandyalu commented Oct 9, 2024

themoviedb.org only provides a youtube trailer id, which is already in Radarr, and Trailarr uses that by default.

@nandyalu
Copy link
Owner

I looked at the code for Apple TV+ trailers download from that script, it looks complicated... so it takes significant effort to add that. Do you think it's worth it?

@Hello-World-Traveler
Copy link

It's a dedicated source that could be better. Maybe it's something to add for a later date?

@nandyalu
Copy link
Owner

nandyalu commented Oct 23, 2024

Trailarr uses yt-dlp to download videos from YouTube, and yt-dlp supports downloading from appletrailers as well as many other sites, so this can be added. However, searching for a trailer is going to be a problem that needs to be solved. The other script to download apple trailers also doesn't provide a method for searching, you need to enter the URL to download.

@Hello-World-Traveler
Copy link

The link makes it more complex then just /move
I had a little go but failed.

This adds movie-ID to the link but doesn't find the second part of the link. I used https://tv.apple.com/us/movie/2073/ umc.cmc. 3ueoyn66rvue7 1zbahr61wntb as example (link has spaces in it)

`def construct_movie_url(movie_id):
    """Construct the URL for the given movie ID."""
    base_url = "https://tv.apple.com/us/movie/"
    return f"{base_url}{movie_id}"

def main():
    # Prompt the user for a movie ID (e.g., "2070")
    movie_id = input("Enter the movie ID you want to search for: ").strip().lower()
    
    # Construct the full URL
    movie_url = construct_movie_url(movie_id)
    
    # Output the constructed URL
    print(f"Movie page URL: {movie_url}")

if __name__ == "__main__":
    main()`

You might be able to do something with this as it doesn't work.

import requests
from bs4 import BeautifulSoup

def fetch_valid_movie_url(movie_id):
    """Fetch the valid movie URL based on the provided movie ID."""
    # Construct the search URL
    search_url = f"https://tv.apple.com/us/movie/{movie_id}"
    
    # Send a request to fetch the page content
    response = requests.get(search_url)
    
    if response.status_code != 200:
        return None  # Return None if the page is not found
    
    soup = BeautifulSoup(response.content, 'html.parser')

    # Look for a specific pattern in the page that contains the valid link
    # This assumes that there's a specific tag or attribute that holds the valid link
    # Check for all links on the page
    movie_links = soup.find_all('a', href=True)

    for link in movie_links:
        # Check if this link contains a valid structure for Apple TV movies
        if "/movie/" in link['href']:
            return f"https://tv.apple.com{link['href']}"
    
    return None

def main():
    # Prompt the user for a movie ID (e.g., "2070")
    movie_id = input("Enter the movie ID you want to search for: ").strip().lower()
    
    # Fetch the full movie URL
    movie_url = fetch_valid_movie_url(movie_id)
    
    if movie_url:
        print(f"Valid Movie page URL: {movie_url}")
    else:
        print(f"No valid movie found for ID '{movie_id}'.")

if __name__ == "__main__":
    main()

Could possibly use https://vimeo.com/ or https://www.fandango.com

for Fandango I looked at https://www.fandango.com/deadpool-and-wolverine-2024-234516/movie-overview and found prodamdfandango.akamaized net/out/v1/8ec5a20b02fe42b3ab0b90e1cd6a1d65/bb1afde999d842e4a4fae6dfa334d0c1/636c09373f7d4bf1ada4e5ad7d33070a/903a74700ade430a99b17d192ed789f4/index_7_1.ts as url.

@DenisSolonevich
Copy link

Just one more opinion about usecase. Plex/JF/Emby already have feature to show/get trailers online but its quality low and its never localized.
The only good way for me is a Trailarr with YouTube search (on other platforms there are just no local content).
For sure it is nice to have more platforms to get trailers but if there is such feature I would like to see it as a turnable/selectable option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants