Skip to content

Commit

Permalink
tests fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
subzeroid committed Dec 16, 2023
1 parent decd742 commit e1eb7ec
Show file tree
Hide file tree
Showing 9 changed files with 234 additions and 212 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.8, 3.9 ]
python-version: [ 3.10 ]
steps:
- name: Check out code
uses: actions/checkout@v3
Expand All @@ -80,9 +80,20 @@ jobs:
with:
requirements: "true"
test-requirements: "true"

- name: Run test
run: python -m unittest tests.FakeClientTestCase
- name: Run user test
run: pytest -sv tests.py::ClientUserTestCase
- name: Run media test
run: pytest -sv tests.py::ClientMediaTestCase
# - name: Run comment test
# run: pytest -sv tests.py::ClientCommentTestCase
# - name: Run location test
# run: pytest -sv tests.py::ClientLocationTestCase
# - name: Run hashtag test
# run: pytest -sv tests.py::ClientHashtagTestCase
- name: Run share test
run: pytest -sv tests.py::ClientShareTestCase
- name: Run highlight test
run: pytest -sv tests.py::ClientHighlightTestCase

build-docs:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The instagrapi more suits for testing or research than a working business!

* [LamaTok](https://lamatok.com/p/B9ScEYIQ) for TikTok API 🔥
* [HikerAPI](https://hikerapi.com/p/bkXQlaVe) for Instagram API ⚡⚡⚡
* [DataLikers](https://datalikers.com/) for Instagram Datasets 🚀
* [DataLikers](https://datalikers.com/p/S9Lv5vBy) for Instagram Datasets 🚀

[![Package](https://github.com/subzeroid/instagrapi/actions/workflows/python-package.yml/badge.svg?branch=master)](https://github.com/subzeroid/instagrapi/actions/workflows/python-package.yml)
[![PyPI](https://img.shields.io/pypi/v/instagrapi)](https://pypi.org/project/instagrapi/)
Expand All @@ -37,7 +37,7 @@ Features:

Fast and effective Instagram Private API wrapper (public+private requests and challenge resolver) without selenium. Use the most recent version of the API from Instagram, which was obtained using reverse-engineering with Charles Proxy and [Proxyman](https://proxyman.io/).

*Instagram API valid for **28 June 2023** (last reverse-engineering check)*
*Instagram API valid for **16 Dec 2023** (last reverse-engineering check)*

Support **Python >= 3.9**

Expand Down
10 changes: 8 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# instagrapi

### We recommend using our services:

* [LamaTok](https://lamatok.com/p/B9ScEYIQ) for TikTok API 🔥
* [HikerAPI](https://hikerapi.com/p/bkXQlaVe) for Instagram API ⚡⚡⚡
* [DataLikers](https://datalikers.com/p/S9Lv5vBy) for Instagram Datasets 🚀

[![Package](https://github.com/subzeroid/instagrapi/actions/workflows/python-package.yml/badge.svg?branch=master)](https://github.com/subzeroid/instagrapi/actions/workflows/python-package.yml)
[![PyPI](https://img.shields.io/pypi/v/instagrapi)][pypi]
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/instagrapi)][pypi]

Fast and effective Instagram Private API wrapper (public+private requests and challenge resolver). Use the most recent version of the API from Instagram, which was obtained using [reverse-engineering with Charles Proxy](https://github.com/subzeroid/instagrapi/discussions/1182) and [Proxyman](https://proxyman.io/).

*Instagram API valid for **13 February 2023** (last reverse-engineering check)*
*Instagram API valid for **16 Dec 2023** (last reverse-engineering check)*

Support **Python >= 3.8**
Support **Python >= 3.9**

For any other languages (e.g. C++, C#, F#, D, [Golang](https://github.com/subzeroid/instagrapi-rest/tree/main/golang), Erlang, Elixir, Nim, Haskell, Lisp, Closure, Julia, R, Java, Kotlin, Scala, OCaml, JavaScript, Crystal, Ruby, Rust, [Swift](https://github.com/subzeroid/instagrapi-rest/tree/main/swift), Objective-C, Visual Basic, .NET, Pascal, Perl, Lua, PHP and others), I suggest using [instagrapi-rest](https://github.com/subzeroid/instagrapi-rest)

Expand Down
4 changes: 2 additions & 2 deletions instagrapi/mixins/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def media_user(self, media_pk: str) -> UserShort:
UserShort
An object of UserShort
"""
return self.media_info(media_pk).user
return self.media_info_v1(media_pk).user

def media_oembed(self, url: str) -> Dict:
"""
Expand Down Expand Up @@ -767,7 +767,7 @@ def user_pinned_medias(self, user_id) -> List[Media]:
)
pinned_medias = []
for media in medias["items"]:
if media.get("timeline_pinned_user_ids") != None:
if media.get("timeline_pinned_user_ids") is not None:
pinned_medias.append(extract_media_v1(media))
self.base_headers["X-IG-Nav-Chain"] = default_nav
return pinned_medias
Expand Down
1 change: 0 additions & 1 deletion instagrapi/mixins/private.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ def __init__(self, *args, **kwargs):
session.mount("https://", adapter)
session.mount("http://", adapter)
self.private = session

self.private.verify = False # fix SSLError/HTTPSConnectionPool
self.email = kwargs.pop("email", None)
self.phone_number = kwargs.pop("phone_number", None)
Expand Down
1 change: 0 additions & 1 deletion instagrapi/mixins/public.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ def __init__(self, *args, **kwargs):
session.mount("https://", adapter)
session.mount("http://", adapter)
self.public = session

self.public.verify = False # fix SSLError/HTTPSConnectionPool
self.public.headers.update(
{
Expand Down
2 changes: 2 additions & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ mkdocs-minify-plugin==0.7.2
mkdocstrings==0.24.0
./util/mkdocs-redirects
./util/mkdocstrings_patch_type_aliases
pytest-xdist==3.3.1
pytest~=7.4.3
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

setup(
name="instagrapi",
version="2.0.1",
version="2.0.2",
author="Mark Subzeroid",
author_email="[email protected]",
license="MIT",
Expand Down Expand Up @@ -69,14 +69,14 @@
long_description=long_description,
long_description_content_type="text/markdown",
packages=find_packages(),
python_requires=">=3.8",
python_requires=">=3.9",
include_package_data=True,
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Topic :: Software Development :: Libraries :: Python Modules",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
],
)
Loading

0 comments on commit e1eb7ec

Please sign in to comment.