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

Вылет при поиске "Матрица", "Солярис" в методе Movie.objects.search() #67

Open
Fan4Metal opened this issue Apr 26, 2022 · 1 comment · May be fixed by #70

Comments

@Fan4Metal
Copy link

Добрый день, при вызове метода Movie.objects.search("Матрица"), Movie.objects.search("Солярис") возникает исключение ValueError: invalid literal for int() with base 10: 'city'.

@HolyNkona
Copy link

HolyNkona commented Jul 6, 2022

Добрый день, при вызове метода Movie.objects.search("Матрица"), Movie.objects.search("Солярис") возникает исключение ValueError: invalid literal for int() with base 10: 'city'.

sources.py
строка 111 (def parse) смени на это и табы правильно выставь

`

    def parse(self):
    self.content = html.fromstring(self.content)
    url = self.extract('url')
    years = self.extract('years')
    title_en = self.extract('title_en', to_str=True)
    rating = self.extract('rating')
    if 'afisha' not in url:
        self.instance.id = self.prepare_int(url.split('/')[2])
    else:
        pass
    self.instance.title = self.extract_title()
    self.instance.series = 'сериал' in self.extract('title')

    if years:
        self.instance.year = self.prepare_int(years[:4])

    if 'мин' in title_en:
        values = title_en.split(', ')
        self.instance.runtime = self.prepare_int(values[-1].split(' ')[0])
        self.instance.title_en = ', '.join(values[:-1])
    else:
        self.instance.title_en = title_en

    if rating:
        rating = rating.split(' ')
        self.instance.rating = float(rating[0])
        self.instance.votes = self.prepare_int(rating[1][1:-1])

    self.instance.set_source('link')

`

@olegsvs olegsvs linked a pull request Aug 1, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants