Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Doubt developing extractors #13095
Doubt developing extractors #13095
Comments
|
Extractors' instances are reused so you can't keep any data that affects extraction between downloads. Needless to say it does not even make any sense to store it. |
I have a doubt about developing extractors.
When creating or developing an extractor, can I save data (state) in a instance of the extractor (like
class MyExtractorIE(InfoExtractor)? In all the code I saw until now, it seems to avoid saving state in the IE object, working with a more functional approach and passing data just as functions arguments. Many helper methods in the classInfoExtractor(inextractor/common.py) kinda follow this behaving like static methods.So, in an extractor, can I save data like the video id and others parameters in the object (eg.
self.webpage = fetched_webpage), or assuming that each download item creates a new instance of anInfoExtractoris wrong, or something else is wrong.