Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Maják
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Maják
Commits
9a94cd6b
Commit
9a94cd6b
authored
1 year ago
by
Tomáš Valenta
Browse files
Options
Downloads
Patches
Plain Diff
switch to Instagram session instead of logging in each time
parent
666e7d50
No related branches found
No related tags found
2 merge requests
!804
Release
,
!797
IG login → IG session
Pipeline
#13759
failed
1 year ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+1
-1
1 addition, 1 deletion
README.md
instagram_utils/services.py
+2
-2
2 additions, 2 deletions
instagram_utils/services.py
majak/settings/base.py
+3
-1
3 additions, 1 deletion
majak/settings/base.py
with
6 additions
and
4 deletions
README.md
+
1
−
1
View file @
9a94cd6b
...
...
@@ -168,7 +168,7 @@ Settings pro appky na weby:
|
`DONATE_PORTAL_REDIRECT_SOURCE`
| dary.pirati.cz | identifikátor zdroje pro přesměrování na darovací portál |
|
`DONATE_PORTAL_API_URL`
| "" | URL s API darovacího portálu |
|
`INSTAGRAM_USERNAME`
| "" | Login username pro Instagram sync |
|
`INSTAGRAM_
PASSWORD
`
| "" | Login
h
es
lo
pro Instagram sync |
|
`INSTAGRAM_
SESSION
`
| "" | Login
s
es
sion
pro Instagram sync |
### Management commands
...
...
This diff is collapsed.
Click to expand it.
instagram_utils/services.py
+
2
−
2
View file @
9a94cd6b
...
...
@@ -45,8 +45,8 @@ class InstagramDownloadService:
def
parse_media_for_user
(
self
,
username
:
str
)
->
None
:
loader
=
instaloader
.
Instaloader
()
if
settings
.
INSTAGRAM_
U
SE
RNAME
and
settings
.
INSTAGRAM_
PASSWORD
:
loader
.
lo
gi
n
(
settings
.
INSTAGRAM_USERNAME
,
settings
.
INSTAGRAM_
PASSWORD
)
if
settings
.
INSTAGRAM_SE
SSION
and
settings
.
INSTAGRAM_
USERNAME
:
loader
.
lo
ad_sessio
n
(
settings
.
INSTAGRAM_USERNAME
,
settings
.
INSTAGRAM_
SESSION
)
profile
=
instaloader
.
Profile
.
from_username
(
loader
.
context
,
username
)
...
...
This diff is collapsed.
Click to expand it.
majak/settings/base.py
+
3
−
1
View file @
9a94cd6b
import
json
from
os.path
import
join
from
pathlib
import
Path
...
...
@@ -309,4 +311,4 @@ MAPS_UTILS_MAPPROXY_URL = env.str(
TWITTER_BEARER_TOKEN
=
env
.
str
(
"
TWITTER_BEARER_TOKEN
"
,
default
=
""
)
INSTAGRAM_USERNAME
=
env
.
str
(
"
INSTAGRAM_USERNAME
"
,
default
=
""
)
INSTAGRAM_
PASSWORD
=
env
.
str
(
"
INSTAGRAM_
PASSWORD
"
,
default
=
""
)
INSTAGRAM_
SESSION
=
json
.
loads
(
env
.
str
(
"
INSTAGRAM_
SESSION
"
,
default
=
"
{{}}
"
)
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment