Skip to content

Does "?expand=" construct work with pyflix2? #10

@paritosh91

Description

@paritosh91

Hi,

Netflix API says that this URL:

http://api-public.netflix.com/catalog/titles/movies/60036637?expand=synopsis%20cast%20directors%20awards%20similars

should work while getting title details. However, the get_title() function has this check for the categories:

if category and EXPANDS.index("@" + category) >= 0:
url = "%s/%s" % (url, category)

This restricts the category to be a singe word and defeats the purpose of having expands. I tried a quick crude fix :

if category :
expansions = category.split()
countOfExp = len(expansions)
countOfLegalExp = 0

            for expansion in expansions:                    
                if EXPANDS.index("@" + expansion.strip()) >= 0:
                    countOfLegalExp += 1

            if countOfExp == countOfLegalExp:
                url="%s?expand=%s" %(url,urllib.quote(category))
            else:
                raise NetflixError("Illegal Expansions present.")

However, this doesn't work. All I get in return is unexpanded data.

Please help.

Regds,
Paritosh

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions