rinalLi

u

1 +# This file must be used with "source bin/activate" *from bash*
2 +# you cannot run it directly
3 +
4 +
5 +if [ "${BASH_SOURCE-}" = "$0" ]; then
6 + echo "You must source this script: \$ source $0" >&2
7 + exit 33
8 +fi
9 +
10 +deactivate () {
11 + unset -f pydoc >/dev/null 2>&1 || true
12 +
13 + # reset old environment variables
14 + # ! [ -z ${VAR+_} ] returns true if VAR is declared at all
15 + if ! [ -z "${_OLD_VIRTUAL_PATH:+_}" ] ; then
16 + PATH="$_OLD_VIRTUAL_PATH"
17 + export PATH
18 + unset _OLD_VIRTUAL_PATH
19 + fi
20 + if ! [ -z "${_OLD_VIRTUAL_PYTHONHOME+_}" ] ; then
21 + PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME"
22 + export PYTHONHOME
23 + unset _OLD_VIRTUAL_PYTHONHOME
24 + fi
25 +
26 + # The hash command must be called to get it to forget past
27 + # commands. Without forgetting past commands the $PATH changes
28 + # we made may not be respected
29 + hash -r 2>/dev/null
30 +
31 + if ! [ -z "${_OLD_VIRTUAL_PS1+_}" ] ; then
32 + PS1="$_OLD_VIRTUAL_PS1"
33 + export PS1
34 + unset _OLD_VIRTUAL_PS1
35 + fi
36 +
37 + unset VIRTUAL_ENV
38 + if [ ! "${1-}" = "nondestructive" ] ; then
39 + # Self destruct!
40 + unset -f deactivate
41 + fi
42 +}
43 +
44 +# unset irrelevant variables
45 +deactivate nondestructive
46 +
47 +VIRTUAL_ENV='/Users/rinal/PycharmProjects/xj-marketing'
48 +if ([ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "msys" ]) && $(command -v cygpath &> /dev/null) ; then
49 + VIRTUAL_ENV=$(cygpath -u "$VIRTUAL_ENV")
50 +fi
51 +export VIRTUAL_ENV
52 +
53 +_OLD_VIRTUAL_PATH="$PATH"
54 +PATH="$VIRTUAL_ENV/bin:$PATH"
55 +export PATH
56 +
57 +# unset PYTHONHOME if set
58 +if ! [ -z "${PYTHONHOME+_}" ] ; then
59 + _OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME"
60 + unset PYTHONHOME
61 +fi
62 +
63 +if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then
64 + _OLD_VIRTUAL_PS1="${PS1-}"
65 + if [ "x" != x ] ; then
66 + PS1="() ${PS1-}"
67 + else
68 + PS1="(`basename \"$VIRTUAL_ENV\"`) ${PS1-}"
69 + fi
70 + export PS1
71 +fi
72 +
73 +# Make sure to unalias pydoc if it's already there
74 +alias pydoc 2>/dev/null >/dev/null && unalias pydoc || true
75 +
76 +pydoc () {
77 + python -m pydoc "$@"
78 +}
79 +
80 +# The hash command must be called to get it to forget past
81 +# commands. Without forgetting past commands the $PATH changes
82 +# we made may not be respected
83 +hash -r 2>/dev/null
1 +# This file must be used with "source bin/activate.csh" *from csh*.
2 +# You cannot run it directly.
3 +# Created by Davide Di Blasi <davidedb@gmail.com>.
4 +
5 +set newline='\
6 +'
7 +
8 +alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH:q" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT:q" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate && unalias pydoc'
9 +
10 +# Unset irrelevant variables.
11 +deactivate nondestructive
12 +
13 +setenv VIRTUAL_ENV '/Users/rinal/PycharmProjects/xj-marketing'
14 +
15 +set _OLD_VIRTUAL_PATH="$PATH:q"
16 +setenv PATH "$VIRTUAL_ENV:q/bin:$PATH:q"
17 +
18 +
19 +
20 +if ('' != "") then
21 + set env_name = '() '
22 +else
23 + set env_name = '('"$VIRTUAL_ENV:t:q"') '
24 +endif
25 +
26 +if ( $?VIRTUAL_ENV_DISABLE_PROMPT ) then
27 + if ( $VIRTUAL_ENV_DISABLE_PROMPT == "" ) then
28 + set do_prompt = "1"
29 + else
30 + set do_prompt = "0"
31 + endif
32 +else
33 + set do_prompt = "1"
34 +endif
35 +
36 +if ( $do_prompt == "1" ) then
37 + # Could be in a non-interactive environment,
38 + # in which case, $prompt is undefined and we wouldn't
39 + # care about the prompt anyway.
40 + if ( $?prompt ) then
41 + set _OLD_VIRTUAL_PROMPT="$prompt:q"
42 + if ( "$prompt:q" =~ *"$newline:q"* ) then
43 + :
44 + else
45 + set prompt = "$env_name:q$prompt:q"
46 + endif
47 + endif
48 +endif
49 +
50 +unset env_name
51 +unset do_prompt
52 +
53 +alias pydoc python -m pydoc
54 +
55 +rehash
1 +# This file must be used using `source bin/activate.fish` *within a running fish ( http://fishshell.com ) session*.
2 +# Do not run it directly.
3 +
4 +function _bashify_path -d "Converts a fish path to something bash can recognize"
5 + set fishy_path $argv
6 + set bashy_path $fishy_path[1]
7 + for path_part in $fishy_path[2..-1]
8 + set bashy_path "$bashy_path:$path_part"
9 + end
10 + echo $bashy_path
11 +end
12 +
13 +function _fishify_path -d "Converts a bash path to something fish can recognize"
14 + echo $argv | tr ':' '\n'
15 +end
16 +
17 +function deactivate -d 'Exit virtualenv mode and return to the normal environment.'
18 + # reset old environment variables
19 + if test -n "$_OLD_VIRTUAL_PATH"
20 + # https://github.com/fish-shell/fish-shell/issues/436 altered PATH handling
21 + if test (echo $FISH_VERSION | head -c 1) -lt 3
22 + set -gx PATH (_fishify_path "$_OLD_VIRTUAL_PATH")
23 + else
24 + set -gx PATH $_OLD_VIRTUAL_PATH
25 + end
26 + set -e _OLD_VIRTUAL_PATH
27 + end
28 +
29 + if test -n "$_OLD_VIRTUAL_PYTHONHOME"
30 + set -gx PYTHONHOME "$_OLD_VIRTUAL_PYTHONHOME"
31 + set -e _OLD_VIRTUAL_PYTHONHOME
32 + end
33 +
34 + if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
35 + and functions -q _old_fish_prompt
36 + # Set an empty local `$fish_function_path` to allow the removal of `fish_prompt` using `functions -e`.
37 + set -l fish_function_path
38 +
39 + # Erase virtualenv's `fish_prompt` and restore the original.
40 + functions -e fish_prompt
41 + functions -c _old_fish_prompt fish_prompt
42 + functions -e _old_fish_prompt
43 + set -e _OLD_FISH_PROMPT_OVERRIDE
44 + end
45 +
46 + set -e VIRTUAL_ENV
47 +
48 + if test "$argv[1]" != 'nondestructive'
49 + # Self-destruct!
50 + functions -e pydoc
51 + functions -e deactivate
52 + functions -e _bashify_path
53 + functions -e _fishify_path
54 + end
55 +end
56 +
57 +# Unset irrelevant variables.
58 +deactivate nondestructive
59 +
60 +set -gx VIRTUAL_ENV '/Users/rinal/PycharmProjects/xj-marketing'
61 +
62 +# https://github.com/fish-shell/fish-shell/issues/436 altered PATH handling
63 +if test (echo $FISH_VERSION | head -c 1) -lt 3
64 + set -gx _OLD_VIRTUAL_PATH (_bashify_path $PATH)
65 +else
66 + set -gx _OLD_VIRTUAL_PATH $PATH
67 +end
68 +set -gx PATH "$VIRTUAL_ENV"'/bin' $PATH
69 +
70 +# Unset `$PYTHONHOME` if set.
71 +if set -q PYTHONHOME
72 + set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME
73 + set -e PYTHONHOME
74 +end
75 +
76 +function pydoc
77 + python -m pydoc $argv
78 +end
79 +
80 +if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
81 + # Copy the current `fish_prompt` function as `_old_fish_prompt`.
82 + functions -c fish_prompt _old_fish_prompt
83 +
84 + function fish_prompt
85 + # Run the user's prompt first; it might depend on (pipe)status.
86 + set -l prompt (_old_fish_prompt)
87 +
88 + # Prompt override provided?
89 + # If not, just prepend the environment name.
90 + if test -n ''
91 + printf '(%s) ' ''
92 + else
93 + printf '(%s) ' (basename "$VIRTUAL_ENV")
94 + end
95 +
96 + string join -- \n $prompt # handle multi-line prompts
97 + end
98 +
99 + set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
100 +end
1 +# Setting all environment variables for the venv
2 +let path-name = (if ((sys).host.name == "Windows") { "Path" } { "PATH" })
3 +let virtual-env = "/Users/rinal/PycharmProjects/xj-marketing"
4 +let bin = "bin"
5 +let path-sep = ":"
6 +
7 +let old-path = ($nu.path | str collect ($path-sep))
8 +
9 +let venv-path = ([$virtual-env $bin] | path join)
10 +let new-path = ($nu.path | prepend $venv-path | str collect ($path-sep))
11 +
12 +# environment variables that will be batched loaded to the virtual env
13 +let new-env = ([
14 + [name, value];
15 + [$path-name $new-path]
16 + [_OLD_VIRTUAL_PATH $old-path]
17 + [VIRTUAL_ENV $virtual-env]
18 +])
19 +
20 +load-env $new-env
21 +
22 +# Creating the new prompt for the session
23 +let virtual_prompt = (if ("" != "") {
24 + "() "
25 +} {
26 + (build-string '(' ($virtual-env | path basename) ') ')
27 +}
28 +)
29 +
30 +# If there is no default prompt, then only the env is printed in the prompt
31 +let new_prompt = (if ( config | select prompt | empty? ) {
32 + ($"build-string '($virtual_prompt)'")
33 +} {
34 + ($"build-string '($virtual_prompt)' (config get prompt | str find-replace "build-string" "")")
35 +})
36 +let-env PROMPT_COMMAND = $new_prompt
37 +
38 +# We are using alias as the function definitions because only aliases can be
39 +# removed from the scope
40 +alias pydoc = python -m pydoc
41 +alias deactivate = source "/Users/rinal/PycharmProjects/xj-marketing/bin/deactivate.nu"
1 +$script:THIS_PATH = $myinvocation.mycommand.path
2 +$script:BASE_DIR = Split-Path (Resolve-Path "$THIS_PATH/..") -Parent
3 +
4 +function global:deactivate([switch] $NonDestructive) {
5 + if (Test-Path variable:_OLD_VIRTUAL_PATH) {
6 + $env:PATH = $variable:_OLD_VIRTUAL_PATH
7 + Remove-Variable "_OLD_VIRTUAL_PATH" -Scope global
8 + }
9 +
10 + if (Test-Path function:_old_virtual_prompt) {
11 + $function:prompt = $function:_old_virtual_prompt
12 + Remove-Item function:\_old_virtual_prompt
13 + }
14 +
15 + if ($env:VIRTUAL_ENV) {
16 + Remove-Item env:VIRTUAL_ENV -ErrorAction SilentlyContinue
17 + }
18 +
19 + if (!$NonDestructive) {
20 + # Self destruct!
21 + Remove-Item function:deactivate
22 + Remove-Item function:pydoc
23 + }
24 +}
25 +
26 +function global:pydoc {
27 + python -m pydoc $args
28 +}
29 +
30 +# unset irrelevant variables
31 +deactivate -nondestructive
32 +
33 +$VIRTUAL_ENV = $BASE_DIR
34 +$env:VIRTUAL_ENV = $VIRTUAL_ENV
35 +
36 +New-Variable -Scope global -Name _OLD_VIRTUAL_PATH -Value $env:PATH
37 +
38 +$env:PATH = "$env:VIRTUAL_ENV/bin:" + $env:PATH
39 +if (!$env:VIRTUAL_ENV_DISABLE_PROMPT) {
40 + function global:_old_virtual_prompt {
41 + ""
42 + }
43 + $function:_old_virtual_prompt = $function:prompt
44 +
45 + if ("" -ne "") {
46 + function global:prompt {
47 + # Add the custom prefix to the existing prompt
48 + $previous_prompt_value = & $function:_old_virtual_prompt
49 + ("() " + $previous_prompt_value)
50 + }
51 + }
52 + else {
53 + function global:prompt {
54 + # Add a prefix to the current prompt, but don't discard it.
55 + $previous_prompt_value = & $function:_old_virtual_prompt
56 + $new_prompt_value = "($( Split-Path $env:VIRTUAL_ENV -Leaf )) "
57 + ($new_prompt_value + $previous_prompt_value)
58 + }
59 + }
60 +}
1 +# -*- coding: utf-8 -*-
2 +"""Activate virtualenv for current interpreter:
3 +
4 +Use exec(open(this_file).read(), {'__file__': this_file}).
5 +
6 +This can be used when you must use an existing Python interpreter, not the virtualenv bin/python.
7 +"""
8 +import os
9 +import site
10 +import sys
11 +
12 +try:
13 + abs_file = os.path.abspath(__file__)
14 +except NameError:
15 + raise AssertionError("You must use exec(open(this_file).read(), {'__file__': this_file}))")
16 +
17 +bin_dir = os.path.dirname(abs_file)
18 +base = bin_dir[: -len("bin") - 1] # strip away the bin part from the __file__, plus the path separator
19 +
20 +# prepend bin to PATH (this file is inside the bin directory)
21 +os.environ["PATH"] = os.pathsep.join([bin_dir] + os.environ.get("PATH", "").split(os.pathsep))
22 +os.environ["VIRTUAL_ENV"] = base # virtual env is right above bin directory
23 +
24 +# add the virtual environments libraries to the host python import mechanism
25 +prev_length = len(sys.path)
26 +for lib in "../lib/python3.12/site-packages".split(os.pathsep):
27 + path = os.path.realpath(os.path.join(bin_dir, lib))
28 + site.addsitedir(path.decode("utf-8") if "" else path)
29 +sys.path[:] = sys.path[prev_length:] + sys.path[0:prev_length]
30 +
31 +sys.real_prefix = sys.prefix
32 +sys.prefix = base
1 +#!/Users/rinal/PycharmProjects/xj-marketing/bin/python3
2 +# -*- coding: utf-8 -*-
3 +import re
4 +import sys
5 +from alembic.config import main
6 +if __name__ == '__main__':
7 + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8 + sys.exit(main())
1 +#!/Users/rinal/PycharmProjects/xj-marketing/bin/python3
2 +# -*- coding: utf-8 -*-
3 +import re
4 +import sys
5 +from biliup.__main__ import arg_parser
6 +if __name__ == '__main__':
7 + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8 + sys.exit(arg_parser())
1 +# Setting the old path
2 +let path-name = (if ((sys).host.name == "Windows") { "Path" } { "PATH" })
3 +let-env $path-name = $nu.env._OLD_VIRTUAL_PATH
4 +
5 +# Unleting the environment variables that were created when activating the env
6 +unlet-env VIRTUAL_ENV
7 +unlet-env _OLD_VIRTUAL_PATH
8 +unlet-env PROMPT_COMMAND
9 +
10 +unalias pydoc
11 +unalias deactivate
1 +#!/Users/rinal/PycharmProjects/xj-marketing/bin/python3
2 +# -*- coding: utf-8 -*-
3 +import re
4 +import sys
5 +from httpx import main
6 +if __name__ == '__main__':
7 + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8 + sys.exit(main())
1 +#!/Users/rinal/PycharmProjects/xj-marketing/bin/python3
2 +# -*- coding: utf-8 -*-
3 +import re
4 +import sys
5 +from mako.cmd import cmdline
6 +if __name__ == '__main__':
7 + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8 + sys.exit(cmdline())
1 +#!/Users/rinal/PycharmProjects/xj-marketing/bin/python3
2 +# -*- coding: utf-8 -*-
3 +import re
4 +import sys
5 +from charset_normalizer.cli import cli_detect
6 +if __name__ == '__main__':
7 + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8 + sys.exit(cli_detect())
1 +#!/Users/rinal/PycharmProjects/xj-marketing/bin/python3
2 +# -*- coding: utf-8 -*-
3 +import re
4 +import sys
5 +from pip._internal.cli.main import main
6 +if __name__ == '__main__':
7 + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8 + sys.exit(main())
1 +#!/Users/rinal/PycharmProjects/xj-marketing/bin/python3
2 +# -*- coding: utf-8 -*-
3 +import re
4 +import sys
5 +from pip._internal.cli.main import main
6 +if __name__ == '__main__':
7 + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8 + sys.exit(main())
1 +#!/Users/rinal/PycharmProjects/xj-marketing/bin/python3
2 +# -*- coding: utf-8 -*-
3 +import re
4 +import sys
5 +from pip._internal.cli.main import main
6 +if __name__ == '__main__':
7 + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8 + sys.exit(main())
1 +#!/Users/rinal/PycharmProjects/xj-marketing/bin/python3
2 +# -*- coding: utf-8 -*-
3 +import re
4 +import sys
5 +from playwright.__main__ import main
6 +if __name__ == '__main__':
7 + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8 + sys.exit(main())
1 +#!/Users/rinal/PycharmProjects/xj-marketing/bin/python3
2 +# -*- coding: utf-8 -*-
3 +import re
4 +import sys
5 +from rsa.cli import decrypt
6 +if __name__ == '__main__':
7 + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8 + sys.exit(decrypt())
1 +#!/Users/rinal/PycharmProjects/xj-marketing/bin/python3
2 +# -*- coding: utf-8 -*-
3 +import re
4 +import sys
5 +from rsa.cli import encrypt
6 +if __name__ == '__main__':
7 + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8 + sys.exit(encrypt())
1 +#!/Users/rinal/PycharmProjects/xj-marketing/bin/python3
2 +# -*- coding: utf-8 -*-
3 +import re
4 +import sys
5 +from rsa.cli import keygen
6 +if __name__ == '__main__':
7 + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8 + sys.exit(keygen())
1 +#!/Users/rinal/PycharmProjects/xj-marketing/bin/python3
2 +# -*- coding: utf-8 -*-
3 +import re
4 +import sys
5 +from rsa.util import private_to_public
6 +if __name__ == '__main__':
7 + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8 + sys.exit(private_to_public())
1 +#!/Users/rinal/PycharmProjects/xj-marketing/bin/python3
2 +# -*- coding: utf-8 -*-
3 +import re
4 +import sys
5 +from rsa.cli import sign
6 +if __name__ == '__main__':
7 + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8 + sys.exit(sign())
1 +#!/Users/rinal/PycharmProjects/xj-marketing/bin/python3
2 +# -*- coding: utf-8 -*-
3 +import re
4 +import sys
5 +from rsa.cli import verify
6 +if __name__ == '__main__':
7 + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8 + sys.exit(verify())
1 +/usr/local/bin/python3.12
...\ No newline at end of file ...\ No newline at end of file
1 +python
...\ No newline at end of file ...\ No newline at end of file
1 +python
...\ No newline at end of file ...\ No newline at end of file
1 +#!/Users/rinal/PycharmProjects/xj-marketing/bin/python3
2 +# -*- coding: utf-8 -*-
3 +import re
4 +import sys
5 +from qrcode.console_scripts import main
6 +if __name__ == '__main__':
7 + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8 + sys.exit(main())
1 +#!/Users/rinal/PycharmProjects/xj-marketing/bin/python3
2 +# -*- coding: utf-8 -*-
3 +import re
4 +import sys
5 +from streamlink_cli.main import main
6 +if __name__ == '__main__':
7 + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8 + sys.exit(main())
1 +#!/Users/rinal/PycharmProjects/xj-marketing/bin/python
2 +# -*- coding: utf-8 -*-
3 +import re
4 +import sys
5 +from wheel.cli import main
6 +if __name__ == '__main__':
7 + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8 + sys.exit(main())
1 +#!/Users/rinal/PycharmProjects/xj-marketing/bin/python
2 +# -*- coding: utf-8 -*-
3 +import re
4 +import sys
5 +from wheel.cli import main
6 +if __name__ == '__main__':
7 + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8 + sys.exit(main())
1 +#!/Users/rinal/PycharmProjects/xj-marketing/bin/python
2 +# -*- coding: utf-8 -*-
3 +import re
4 +import sys
5 +from wheel.cli import main
6 +if __name__ == '__main__':
7 + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8 + sys.exit(main())
1 +#!/Users/rinal/PycharmProjects/xj-marketing/bin/python
2 +# -*- coding: utf-8 -*-
3 +import re
4 +import sys
5 +from wheel.cli import main
6 +if __name__ == '__main__':
7 + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8 + sys.exit(main())
1 +#!/Users/rinal/PycharmProjects/xj-marketing/bin/python3
2 +# -*- coding: utf-8 -*-
3 +import re
4 +import sys
5 +from websocket._wsdump import main
6 +if __name__ == '__main__':
7 + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8 + sys.exit(main())
1 +#!/Users/rinal/PycharmProjects/xj-marketing/bin/python3
2 +# -*- coding: utf-8 -*-
3 +import re
4 +import sys
5 +from cykdl.__main__ import main
6 +if __name__ == '__main__':
7 + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8 + sys.exit(main())
1 +#!/Users/rinal/PycharmProjects/xj-marketing/bin/python3
2 +# -*- coding: utf-8 -*-
3 +import re
4 +import sys
5 +from yt_dlp import main
6 +if __name__ == '__main__':
7 + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8 + sys.exit(main())
1 +/* -*- indent-tabs-mode: nil; tab-width: 4; -*- */
2 +
3 +/* Greenlet object interface */
4 +
5 +#ifndef Py_GREENLETOBJECT_H
6 +#define Py_GREENLETOBJECT_H
7 +
8 +
9 +#include <Python.h>
10 +
11 +#ifdef __cplusplus
12 +extern "C" {
13 +#endif
14 +
15 +/* This is deprecated and undocumented. It does not change. */
16 +#define GREENLET_VERSION "1.0.0"
17 +
18 +#ifndef GREENLET_MODULE
19 +#define implementation_ptr_t void*
20 +#endif
21 +
22 +typedef struct _greenlet {
23 + PyObject_HEAD
24 + PyObject* weakreflist;
25 + PyObject* dict;
26 + implementation_ptr_t pimpl;
27 +} PyGreenlet;
28 +
29 +#define PyGreenlet_Check(op) (op && PyObject_TypeCheck(op, &PyGreenlet_Type))
30 +
31 +
32 +/* C API functions */
33 +
34 +/* Total number of symbols that are exported */
35 +#define PyGreenlet_API_pointers 12
36 +
37 +#define PyGreenlet_Type_NUM 0
38 +#define PyExc_GreenletError_NUM 1
39 +#define PyExc_GreenletExit_NUM 2
40 +
41 +#define PyGreenlet_New_NUM 3
42 +#define PyGreenlet_GetCurrent_NUM 4
43 +#define PyGreenlet_Throw_NUM 5
44 +#define PyGreenlet_Switch_NUM 6
45 +#define PyGreenlet_SetParent_NUM 7
46 +
47 +#define PyGreenlet_MAIN_NUM 8
48 +#define PyGreenlet_STARTED_NUM 9
49 +#define PyGreenlet_ACTIVE_NUM 10
50 +#define PyGreenlet_GET_PARENT_NUM 11
51 +
52 +#ifndef GREENLET_MODULE
53 +/* This section is used by modules that uses the greenlet C API */
54 +static void** _PyGreenlet_API = NULL;
55 +
56 +# define PyGreenlet_Type \
57 + (*(PyTypeObject*)_PyGreenlet_API[PyGreenlet_Type_NUM])
58 +
59 +# define PyExc_GreenletError \
60 + ((PyObject*)_PyGreenlet_API[PyExc_GreenletError_NUM])
61 +
62 +# define PyExc_GreenletExit \
63 + ((PyObject*)_PyGreenlet_API[PyExc_GreenletExit_NUM])
64 +
65 +/*
66 + * PyGreenlet_New(PyObject *args)
67 + *
68 + * greenlet.greenlet(run, parent=None)
69 + */
70 +# define PyGreenlet_New \
71 + (*(PyGreenlet * (*)(PyObject * run, PyGreenlet * parent)) \
72 + _PyGreenlet_API[PyGreenlet_New_NUM])
73 +
74 +/*
75 + * PyGreenlet_GetCurrent(void)
76 + *
77 + * greenlet.getcurrent()
78 + */
79 +# define PyGreenlet_GetCurrent \
80 + (*(PyGreenlet * (*)(void)) _PyGreenlet_API[PyGreenlet_GetCurrent_NUM])
81 +
82 +/*
83 + * PyGreenlet_Throw(
84 + * PyGreenlet *greenlet,
85 + * PyObject *typ,
86 + * PyObject *val,
87 + * PyObject *tb)
88 + *
89 + * g.throw(...)
90 + */
91 +# define PyGreenlet_Throw \
92 + (*(PyObject * (*)(PyGreenlet * self, \
93 + PyObject * typ, \
94 + PyObject * val, \
95 + PyObject * tb)) \
96 + _PyGreenlet_API[PyGreenlet_Throw_NUM])
97 +
98 +/*
99 + * PyGreenlet_Switch(PyGreenlet *greenlet, PyObject *args)
100 + *
101 + * g.switch(*args, **kwargs)
102 + */
103 +# define PyGreenlet_Switch \
104 + (*(PyObject * \
105 + (*)(PyGreenlet * greenlet, PyObject * args, PyObject * kwargs)) \
106 + _PyGreenlet_API[PyGreenlet_Switch_NUM])
107 +
108 +/*
109 + * PyGreenlet_SetParent(PyObject *greenlet, PyObject *new_parent)
110 + *
111 + * g.parent = new_parent
112 + */
113 +# define PyGreenlet_SetParent \
114 + (*(int (*)(PyGreenlet * greenlet, PyGreenlet * nparent)) \
115 + _PyGreenlet_API[PyGreenlet_SetParent_NUM])
116 +
117 +/*
118 + * PyGreenlet_GetParent(PyObject* greenlet)
119 + *
120 + * return greenlet.parent;
121 + *
122 + * This could return NULL even if there is no exception active.
123 + * If it does not return NULL, you are responsible for decrementing the
124 + * reference count.
125 + */
126 +# define PyGreenlet_GetParent \
127 + (*(PyGreenlet* (*)(PyGreenlet*)) \
128 + _PyGreenlet_API[PyGreenlet_GET_PARENT_NUM])
129 +
130 +/*
131 + * deprecated, undocumented alias.
132 + */
133 +# define PyGreenlet_GET_PARENT PyGreenlet_GetParent
134 +
135 +# define PyGreenlet_MAIN \
136 + (*(int (*)(PyGreenlet*)) \
137 + _PyGreenlet_API[PyGreenlet_MAIN_NUM])
138 +
139 +# define PyGreenlet_STARTED \
140 + (*(int (*)(PyGreenlet*)) \
141 + _PyGreenlet_API[PyGreenlet_STARTED_NUM])
142 +
143 +# define PyGreenlet_ACTIVE \
144 + (*(int (*)(PyGreenlet*)) \
145 + _PyGreenlet_API[PyGreenlet_ACTIVE_NUM])
146 +
147 +
148 +
149 +
150 +/* Macro that imports greenlet and initializes C API */
151 +/* NOTE: This has actually moved to ``greenlet._greenlet._C_API``, but we
152 + keep the older definition to be sure older code that might have a copy of
153 + the header still works. */
154 +# define PyGreenlet_Import() \
155 + { \
156 + _PyGreenlet_API = (void**)PyCapsule_Import("greenlet._C_API", 0); \
157 + }
158 +
159 +#endif /* GREENLET_MODULE */
160 +
161 +#ifdef __cplusplus
162 +}
163 +#endif
164 +#endif /* !Py_GREENLETOBJECT_H */
1 +from playwright.sync_api import sync_playwright
2 +import asyncio
3 +
4 +import asyncio
5 +import json
6 +from playwright.async_api import async_playwright, expect
7 +
8 +
9 +async def write_cookies_to_file(cookies, file_path):
10 +
11 + with open(file_path, 'w') as f:
12 + json.dump(cookies, f)
13 +
14 +
15 +async def read_cookies_from_file(file_path):
16 + try:
17 + with open(file_path, 'r') as f:
18 + return json.load(f)
19 + except FileNotFoundError:
20 + return []
21 +
22 +
23 +async def main():
24 + filePath = "/Users/rinal/Downloads/xhs.json"
25 + async with async_playwright() as p:
26 + browser = await p.chromium.launch(headless=False)
27 + context = await browser.new_context()
28 + page = await context.new_page()
29 + await page.goto("https://www.xiaohongshu.com")
30 + print(await page.title()) # login-container
31 + await page.wait_for_selector("div.link-wrapper a.link-wrapper span.channel")
32 +
33 + await asyncio.sleep(3)
34 + cookies = await context.cookies()
35 + print(cookies)
36 + await write_cookies_to_file(cookies, filePath)
37 +
38 + await browser.close()
39 +
40 +
41 +async def upload():
42 + filePath = "/Users/rinal/Downloads/xhs.json"
43 + print(filePath)
44 + async with async_playwright() as p:
45 + browser = await p.chromium.launch()
46 + context = await browser.new_context()
47 + page = await context.new_page()
48 + saved_cookies = await read_cookies_from_file(filePath)
49 + await context.add_cookies(saved_cookies)
50 + await page.goto("https://www.xiaohongshu.com") # 再次访问对应网址,此时带着之前保存的cookie
51 + await page.wait_for_selector("div.link-wrapper a.link-wrapper span.channel")
52 + await page.goto("https://creator.xiaohongshu.com/publish/publish?source=official")
53 + await page.locator("input.upload-input").set_input_files(
54 + "/Users/rinal/PycharmProjects/xj-marketing/videos/huahua.mp4")
55 + button_elem = page.locator('button div span:has-text("发布")')
56 + await button_elem.wait_for(state='visible') # 确保按钮可见
57 +
58 + await page.locator("div.titleInput div div input").fill("花花")
59 + tags = ['花花', '熊猫']
60 + inputTag = page.locator('id=quillEditor').locator('div p')
61 + await inputTag.click()
62 + for index, tag in enumerate(tags, start=1):
63 + await page.keyboard.type(f"#{tag} ")
64 + await asyncio.sleep(2)
65 +
66 + print("已写完tag")
67 + await asyncio.sleep(10)
68 + await button_elem.click()
69 +
70 + await page.wait_for_selector('p:has-text("发布成功")')
71 +
72 + await browser.close()
73 +
74 +
75 +# asyncio.run(main())
76 +asyncio.run(upload())
77 +
78 +#
...\ No newline at end of file ...\ No newline at end of file
1 +home = /Library/Frameworks/Python.framework/Versions/3.12
2 +implementation = CPython
3 +version_info = 3.12.8.final.0
4 +virtualenv = 20.13.0
5 +include-system-site-packages = false
6 +base-prefix = /Library/Frameworks/Python.framework/Versions/3.12
7 +base-exec-prefix = /Library/Frameworks/Python.framework/Versions/3.12
8 +base-executable = /usr/local/bin/python3.12
This diff is collapsed. Click to expand it.
1 +__yt_dlp()
2 +{
3 + local cur prev opts fileopts diropts keywords
4 + COMPREPLY=()
5 + cur="${COMP_WORDS[COMP_CWORD]}"
6 + prev="${COMP_WORDS[COMP_CWORD-1]}"
7 + opts="--help --version --update --no-update --update-to --ignore-errors --no-abort-on-error --abort-on-error --dump-user-agent --list-extractors --extractor-descriptions --use-extractors --force-generic-extractor --default-search --ignore-config --no-config-locations --config-locations --plugin-dirs --flat-playlist --no-flat-playlist --live-from-start --no-live-from-start --wait-for-video --no-wait-for-video --mark-watched --no-mark-watched --no-colors --color --compat-options --alias --proxy --socket-timeout --source-address --impersonate --list-impersonate-targets --force-ipv4 --force-ipv6 --enable-file-urls --geo-verification-proxy --cn-verification-proxy --xff --geo-bypass --no-geo-bypass --geo-bypass-country --geo-bypass-ip-block --playlist-start --playlist-end --playlist-items --match-title --reject-title --min-filesize --max-filesize --date --datebefore --dateafter --min-views --max-views --match-filters --no-match-filters --break-match-filters --no-break-match-filters --no-playlist --yes-playlist --age-limit --download-archive --no-download-archive --max-downloads --break-on-existing --no-break-on-existing --break-on-reject --break-per-input --no-break-per-input --skip-playlist-after-errors --include-ads --no-include-ads --concurrent-fragments --limit-rate --throttled-rate --retries --file-access-retries --fragment-retries --retry-sleep --skip-unavailable-fragments --abort-on-unavailable-fragments --keep-fragments --no-keep-fragments --buffer-size --resize-buffer --no-resize-buffer --http-chunk-size --test --playlist-reverse --no-playlist-reverse --playlist-random --lazy-playlist --no-lazy-playlist --xattr-set-filesize --hls-prefer-native --hls-prefer-ffmpeg --hls-use-mpegts --no-hls-use-mpegts --download-sections --downloader --downloader-args --batch-file --no-batch-file --id --paths --output --output-na-placeholder --autonumber-size --autonumber-start --restrict-filenames --no-restrict-filenames --windows-filenames --no-windows-filenames --trim-filenames --no-overwrites --force-overwrites --no-force-overwrites --continue --no-continue --part --no-part --mtime --no-mtime --write-description --no-write-description --write-info-json --no-write-info-json --write-annotations --no-write-annotations --write-playlist-metafiles --no-write-playlist-metafiles --clean-info-json --no-clean-info-json --write-comments --no-write-comments --load-info-json --cookies --no-cookies --cookies-from-browser --no-cookies-from-browser --cache-dir --no-cache-dir --rm-cache-dir --write-thumbnail --no-write-thumbnail --write-all-thumbnails --list-thumbnails --write-link --write-url-link --write-webloc-link --write-desktop-link --quiet --no-quiet --no-warnings --simulate --no-simulate --ignore-no-formats-error --no-ignore-no-formats-error --skip-download --print --print-to-file --get-url --get-title --get-id --get-thumbnail --get-description --get-duration --get-filename --get-format --dump-json --dump-single-json --print-json --force-write-archive --newline --no-progress --progress --console-title --progress-template --progress-delta --verbose --dump-pages --write-pages --load-pages --youtube-print-sig-code --print-traffic --call-home --no-call-home --encoding --legacy-server-connect --no-check-certificates --prefer-insecure --user-agent --referer --add-headers --bidi-workaround --sleep-requests --sleep-interval --max-sleep-interval --sleep-subtitles --format --format-sort --format-sort-force --no-format-sort-force --video-multistreams --no-video-multistreams --audio-multistreams --no-audio-multistreams --all-formats --prefer-free-formats --no-prefer-free-formats --check-formats --check-all-formats --no-check-formats --list-formats --list-formats-as-table --list-formats-old --merge-output-format --allow-unplayable-formats --no-allow-unplayable-formats --write-subs --no-write-subs --write-auto-subs --no-write-auto-subs --all-subs --list-subs --sub-format --sub-langs --username --password --twofactor --netrc --netrc-location --netrc-cmd --video-password --ap-mso --ap-username --ap-password --ap-list-mso --client-certificate --client-certificate-key --client-certificate-password --extract-audio --audio-format --audio-quality --remux-video --recode-video --postprocessor-args --keep-video --no-keep-video --post-overwrites --no-post-overwrites --embed-subs --no-embed-subs --embed-thumbnail --no-embed-thumbnail --embed-metadata --no-embed-metadata --embed-chapters --no-embed-chapters --embed-info-json --no-embed-info-json --metadata-from-title --parse-metadata --replace-in-metadata --xattrs --concat-playlist --fixup --prefer-avconv --prefer-ffmpeg --ffmpeg-location --exec --no-exec --exec-before-download --no-exec-before-download --convert-subs --convert-thumbnails --split-chapters --no-split-chapters --remove-chapters --no-remove-chapters --force-keyframes-at-cuts --no-force-keyframes-at-cuts --use-postprocessor --sponsorblock-mark --sponsorblock-remove --sponsorblock-chapter-title --no-sponsorblock --sponsorblock-api --sponskrub --no-sponskrub --sponskrub-cut --no-sponskrub-cut --sponskrub-force --no-sponskrub-force --sponskrub-location --sponskrub-args --extractor-retries --allow-dynamic-mpd --ignore-dynamic-mpd --hls-split-discontinuity --no-hls-split-discontinuity --extractor-args --youtube-include-dash-manifest --youtube-skip-dash-manifest --youtube-include-hls-manifest --youtube-skip-hls-manifest"
8 + keywords=":ytfavorites :ytrecommended :ytsubscriptions :ytwatchlater :ythistory"
9 + fileopts="-a|--batch-file|--download-archive|--cookies|--load-info"
10 + diropts="--cache-dir"
11 +
12 + if [[ ${prev} =~ ${fileopts} ]]; then
13 + COMPREPLY=( $(compgen -f -- ${cur}) )
14 + return 0
15 + elif [[ ${prev} =~ ${diropts} ]]; then
16 + COMPREPLY=( $(compgen -d -- ${cur}) )
17 + return 0
18 + fi
19 +
20 + if [[ ${cur} =~ : ]]; then
21 + COMPREPLY=( $(compgen -W "${keywords}" -- ${cur}) )
22 + return 0
23 + elif [[ ${cur} == * ]] ; then
24 + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
25 + return 0
26 + fi
27 +}
28 +
29 +complete -F __yt_dlp yt-dlp
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
1 +#compdef yt-dlp
2 +
3 +__yt_dlp() {
4 + local curcontext="$curcontext" fileopts diropts cur prev
5 + typeset -A opt_args
6 + fileopts="--download-archive|-a|--batch-file|--load-info-json|--load-info|--cookies|--no-cookies"
7 + diropts="--cache-dir"
8 + cur=$words[CURRENT]
9 + case $cur in
10 + :)
11 + _arguments '*: :(::ytfavorites ::ytrecommended ::ytsubscriptions ::ytwatchlater ::ythistory)'
12 + ;;
13 + *)
14 + prev=$words[CURRENT-1]
15 + if [[ ${prev} =~ ${fileopts} ]]; then
16 + _path_files
17 + elif [[ ${prev} =~ ${diropts} ]]; then
18 + _path_files -/
19 + elif [[ ${prev} == "--remux-video" ]]; then
20 + _arguments '*: :(mp4 mkv)'
21 + elif [[ ${prev} == "--recode-video" ]]; then
22 + _arguments '*: :(mp4 flv ogg webm mkv)'
23 + else
24 + _arguments '*: :(--help --version --update --no-update --update-to --ignore-errors --no-abort-on-error --abort-on-error --dump-user-agent --list-extractors --extractor-descriptions --use-extractors --force-generic-extractor --default-search --ignore-config --no-config-locations --config-locations --plugin-dirs --flat-playlist --no-flat-playlist --live-from-start --no-live-from-start --wait-for-video --no-wait-for-video --mark-watched --no-mark-watched --no-colors --color --compat-options --alias --proxy --socket-timeout --source-address --impersonate --list-impersonate-targets --force-ipv4 --force-ipv6 --enable-file-urls --geo-verification-proxy --cn-verification-proxy --xff --geo-bypass --no-geo-bypass --geo-bypass-country --geo-bypass-ip-block --playlist-start --playlist-end --playlist-items --match-title --reject-title --min-filesize --max-filesize --date --datebefore --dateafter --min-views --max-views --match-filters --no-match-filters --break-match-filters --no-break-match-filters --no-playlist --yes-playlist --age-limit --download-archive --no-download-archive --max-downloads --break-on-existing --no-break-on-existing --break-on-reject --break-per-input --no-break-per-input --skip-playlist-after-errors --include-ads --no-include-ads --concurrent-fragments --limit-rate --throttled-rate --retries --file-access-retries --fragment-retries --retry-sleep --skip-unavailable-fragments --abort-on-unavailable-fragments --keep-fragments --no-keep-fragments --buffer-size --resize-buffer --no-resize-buffer --http-chunk-size --test --playlist-reverse --no-playlist-reverse --playlist-random --lazy-playlist --no-lazy-playlist --xattr-set-filesize --hls-prefer-native --hls-prefer-ffmpeg --hls-use-mpegts --no-hls-use-mpegts --download-sections --downloader --downloader-args --batch-file --no-batch-file --id --paths --output --output-na-placeholder --autonumber-size --autonumber-start --restrict-filenames --no-restrict-filenames --windows-filenames --no-windows-filenames --trim-filenames --no-overwrites --force-overwrites --no-force-overwrites --continue --no-continue --part --no-part --mtime --no-mtime --write-description --no-write-description --write-info-json --no-write-info-json --write-annotations --no-write-annotations --write-playlist-metafiles --no-write-playlist-metafiles --clean-info-json --no-clean-info-json --write-comments --no-write-comments --load-info-json --cookies --no-cookies --cookies-from-browser --no-cookies-from-browser --cache-dir --no-cache-dir --rm-cache-dir --write-thumbnail --no-write-thumbnail --write-all-thumbnails --list-thumbnails --write-link --write-url-link --write-webloc-link --write-desktop-link --quiet --no-quiet --no-warnings --simulate --no-simulate --ignore-no-formats-error --no-ignore-no-formats-error --skip-download --print --print-to-file --get-url --get-title --get-id --get-thumbnail --get-description --get-duration --get-filename --get-format --dump-json --dump-single-json --print-json --force-write-archive --newline --no-progress --progress --console-title --progress-template --progress-delta --verbose --dump-pages --write-pages --load-pages --youtube-print-sig-code --print-traffic --call-home --no-call-home --encoding --legacy-server-connect --no-check-certificates --prefer-insecure --user-agent --referer --add-headers --bidi-workaround --sleep-requests --sleep-interval --max-sleep-interval --sleep-subtitles --format --format-sort --format-sort-force --no-format-sort-force --video-multistreams --no-video-multistreams --audio-multistreams --no-audio-multistreams --all-formats --prefer-free-formats --no-prefer-free-formats --check-formats --check-all-formats --no-check-formats --list-formats --list-formats-as-table --list-formats-old --merge-output-format --allow-unplayable-formats --no-allow-unplayable-formats --write-subs --no-write-subs --write-auto-subs --no-write-auto-subs --all-subs --list-subs --sub-format --sub-langs --username --password --twofactor --netrc --netrc-location --netrc-cmd --video-password --ap-mso --ap-username --ap-password --ap-list-mso --client-certificate --client-certificate-key --client-certificate-password --extract-audio --audio-format --audio-quality --remux-video --recode-video --postprocessor-args --keep-video --no-keep-video --post-overwrites --no-post-overwrites --embed-subs --no-embed-subs --embed-thumbnail --no-embed-thumbnail --embed-metadata --no-embed-metadata --embed-chapters --no-embed-chapters --embed-info-json --no-embed-info-json --metadata-from-title --parse-metadata --replace-in-metadata --xattrs --concat-playlist --fixup --prefer-avconv --prefer-ffmpeg --ffmpeg-location --exec --no-exec --exec-before-download --no-exec-before-download --convert-subs --convert-thumbnails --split-chapters --no-split-chapters --remove-chapters --no-remove-chapters --force-keyframes-at-cuts --no-force-keyframes-at-cuts --use-postprocessor --sponsorblock-mark --sponsorblock-remove --sponsorblock-chapter-title --no-sponsorblock --sponsorblock-api --sponskrub --no-sponskrub --sponskrub-cut --no-sponskrub-cut --sponskrub-force --no-sponskrub-force --sponskrub-location --sponskrub-args --extractor-retries --allow-dynamic-mpd --ignore-dynamic-mpd --hls-split-discontinuity --no-hls-split-discontinuity --extractor-args --youtube-include-dash-manifest --youtube-skip-dash-manifest --youtube-include-hls-manifest --youtube-skip-hls-manifest)'
25 + fi
26 + ;;
27 + esac
28 +}
29 +
30 +__yt_dlp
...\ No newline at end of file ...\ No newline at end of file
...@@ -72,12 +72,11 @@ async def get_xhs_cookie(account_file): ...@@ -72,12 +72,11 @@ async def get_xhs_cookie(account_file):
72 await page.goto("https://www.xiaohongshu.com") 72 await page.goto("https://www.xiaohongshu.com")
73 await asyncio.sleep(1) 73 await asyncio.sleep(1)
74 await page.wait_for_selector("div.link-wrapper a.link-wrapper span.channel", timeout=50000) 74 await page.wait_for_selector("div.link-wrapper a.link-wrapper span.channel", timeout=50000)
75 - print("小红书登录成功") 75 + xhs_logger.info("小红书登录成功")
76 await asyncio.sleep(3) 76 await asyncio.sleep(3)
77 77
78 # await page.pause() 78 # await page.pause()
79 # 点击调试器的继续,保存cookie 79 # 点击调试器的继续,保存cookie
80 - await asyncio.sleep(3)
81 cookies = await context.cookies() 80 cookies = await context.cookies()
82 await write_cookies_to_file(cookies, account_file) 81 await write_cookies_to_file(cookies, account_file)
83 82
......
No preview for this file type
1 +美丽的花花
2 +#花花 #熊猫 #奋斗使者 #短视频
...\ No newline at end of file ...\ No newline at end of file