mirror of
https://github.com/bellingcat/snscrape.git
synced 2026-06-08 02:28:29 +03:00
Move CLI methods to end of class definition for consistent code style
This commit is contained in:
@@ -155,14 +155,6 @@ class InstagramUserScraper(_InstagramCommonScraper):
|
||||
self._queryHash = 'f2405b236d85e8296cf30347c9f08c2a'
|
||||
self._variablesFormat = '{{"id":"{pageID}","first":50,"after":"{endCursor}"}}'
|
||||
|
||||
@classmethod
|
||||
def _cli_setup_parser(cls, subparser):
|
||||
subparser.add_argument('username', type = snscrape.base.nonempty_string('username'), help = 'An Instagram username (no leading @)')
|
||||
|
||||
@classmethod
|
||||
def _cli_from_args(cls, args):
|
||||
return cls._cli_construct(args, args.username)
|
||||
|
||||
def _get_entity(self):
|
||||
r = self._initial_page()
|
||||
if r.status_code != 200:
|
||||
@@ -196,6 +188,14 @@ class InstagramUserScraper(_InstagramCommonScraper):
|
||||
posts = posts,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def _cli_setup_parser(cls, subparser):
|
||||
subparser.add_argument('username', type = snscrape.base.nonempty_string('username'), help = 'An Instagram username (no leading @)')
|
||||
|
||||
@classmethod
|
||||
def _cli_from_args(cls, args):
|
||||
return cls._cli_construct(args, args.username)
|
||||
|
||||
|
||||
class InstagramHashtagScraper(_InstagramCommonScraper):
|
||||
name = 'instagram-hashtag'
|
||||
|
||||
Reference in New Issue
Block a user