Skip to content

Add filmweb_watchlist input plugin#2034

Merged
liiight merged 1 commit intoFlexget:developfrom
dolohow:filmweb
Jan 5, 2018
Merged

Add filmweb_watchlist input plugin#2034
liiight merged 1 commit intoFlexget:developfrom
dolohow:filmweb

Conversation

@dolohow
Copy link
Copy Markdown

@dolohow dolohow commented Dec 8, 2017

Motivation for changes:

I want to be able to use my filmweb watch list as an input for Flexget.

Requirements

pip install pyfilmweb==0.1.1.1

Config usage if relevant (new plugin or updated schema):

tasks:
  populate-movie-list:
    filmweb_watchlist:
      login: 'username/email'
      password: 'password'
      min_star: 5
    accept_all: yes

Log and/or tests output (preferably both):

2017-12-08 16:38 VERBOSE  filmweb_watchlist populate-movie-list Retrieving filmweb watch list for user: user
2017-12-08 16:38 VERBOSE  filmweb_watchlist populate-movie-list Logging as user
2017-12-08 16:38 VERBOSE  filmweb_watchlist populate-movie-list Filmweb list contains 385 items
2017-12-08 16:38 VERBOSE  details       populate-movie-list Produced 3 entries.
2017-12-08 16:38 VERBOSE  task          populate-movie-list ACCEPTED: `Movie #1 (2017)` by accept_all plugin
2017-12-08 16:38 VERBOSE  task          populate-movie-list ACCEPTED: `Movie #2 (2017)` by accept_all plugin
2017-12-08 16:38 VERBOSE  task          populate-movie-list ACCEPTED: `Movie #3 (2017)` by accept_all plugin
2017-12-08 16:38 VERBOSE  details       populate-movie-list Summary - Accepted: 3 (Rejected: 0 Undecided: 0 Failed: 0)

To Do:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a very good assumption. What if something changes and it's no longer sorted or sorted differently?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. Fixed

@dolohow dolohow force-pushed the filmweb branch 2 times, most recently from 15252bd to 77ac065 Compare December 8, 2017 16:31
@dolohow
Copy link
Copy Markdown
Author

dolohow commented Dec 14, 2017

Any plans on merging?

@dolohow
Copy link
Copy Markdown
Author

dolohow commented Dec 19, 2017

Is there anything I can do to make this go into develop? @cvium @liiight

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pattern is kinda weird. We have a DependencyError exception for scenarios like this one

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to call str here

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't work without str.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you test on both python 2 and 3? If it expects bytes it need to be handled differently

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works in Python 3 without str. What should I do then?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please paste the error you get without it on python 2

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2017-12-21 13:27 CRITICAL plugin        populate-movie-list Authentication request failed, reason (20, u'Incorrect JSON format')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addfrom builtins import *
and then readd the str.

Does this work correctly for both cases?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this line

from builtins import *  # noqa pylint: disable=unused-import, redefined-builtin

and left this line

fw.login(str(config['login']), str(config['password']))

untouched

Works both python 2 and 3.

Is this what you wanted to me to change?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put this import at the top, directly below __future__

@liiight
Copy link
Copy Markdown
Member

liiight commented Jan 4, 2018

Please resync from develop branch

@dolohow
Copy link
Copy Markdown
Author

dolohow commented Jan 4, 2018

Done

@liiight
Copy link
Copy Markdown
Member

liiight commented Jan 4, 2018

Bah, can you please fix that codacy issue so everything will be green please? 😁

@dolohow
Copy link
Copy Markdown
Author

dolohow commented Jan 5, 2018

I am using DependencyError now when detecting if pyfilmweb is installed. This pattern is used across many plugins and apparently Codacy ignores # noqa.

Not sure what I can do about that.

@liiight liiight merged commit da45c5f into Flexget:develop Jan 5, 2018
@liiight
Copy link
Copy Markdown
Member

liiight commented Jan 5, 2018

Nm, merged.
Wanna update the wiki?

@dolohow
Copy link
Copy Markdown
Author

dolohow commented Jan 5, 2018

sure

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 this pull request may close these issues.

3 participants