ここのYouTubeWinが使えなくなりました

Top
    非常に残念ですが、ここのYouTubeWinは動きません!
    
    理由は、
    wx.html2.WebView.Newを使用していますが、
    youTubeからブロックされてしまいました!
    (多分!)
    
    残念、残念!

    wxは、wxPythonはです。
    (ソースコードを参照して下さい)
       
ウィキペディアより
    wxPythonはPythonで記述されたクロスプラットフォームなウィジェット・ツールキットである。
    wxPythonはロビン・ダンがHP-UXシステム上でGUIを必要として生み出された。
    wxPythonはwxWidgetsと同フリーソフトウェアライセンスが適用されている。
    これはフリーソフトウェア財団とOpen Source Initiativeによって認可されたライセンスである。



解決策を考えてみた(検索した) wx.html2.WebView ここで、WEBVIEW_BACKEND_EDGE (MSW)を使うとできるかな? 試していませんが、誰か教えてくれるといいな~ 最後に、wxPythonのアップグレードで動くのかと思ったが… *** 実装 *** self.browser = wx.html2.WebView.New(self,backend=wx.html2.WebViewBackendEdge) ( IEなら、backend=wx.html2.WebViewBackendIE ) The Edge (Chromium) backend uses Microsoft’s Edge WebView2. It is available for Windows 7 and newer. The following features are currently unsupported with this backend: virtual filesystems, custom urls, find. This backend is not enabled by default, to build it follow these steps: *Visual Studio 2015, or newer, is required *Download the WebView2 SDK nuget package (Version 1.0.622.22 or newer) *Extract the package (it’s a zip archive) to Widgets/3rdparty/webview2 (you should have 3rdparty/webview2/build/native/include/WebView2.h file after unpacking it) *Enable USE_WEBVIEW_EDGE in CMake or setup.h *Build wxWidgets webview library *Copy WebView2Loader.dll from the subdirectory corresponding to the architecture used (x86 or x64) of Widgets/3rdparty/webview2/build/ to your applications executable *At runtime you can use wx.html2.WebView.IsBackendAvailable to check if the backend can be used (it will be available if WebView2Loader.dll can be loaded and Edge (Chromium) is installed) Make sure to add a note about using the WebView2 SDK to your application documentation, as required by its licence ***グーグル翻訳 Edge(Chromium)バックエンドはMicrosoftの Edge WebView2。 Windows7以降で利用できます。 現在、このバックエンドでは次の機能がサポートされていません:仮想ファイルシステム、カスタムURL、検索。 このバックエンドはデフォルトでは有効になっていません。ビルドするには、次の手順に従います。 ・Visual Studio2015以降が必要です ・WebView2 SDK nugetパッケージ(バージョン1.0.622.22以降)をダウンロードします ・パッケージ(zipアーカイブ)をWidgets / 3rdparty / webview2に解凍します  (解凍後、3rdparty / webview2 / build / native / include / WebView2.hファイルが必要です) ・CMakeまたはsetup.hでUSE_WEBVIEW_EDGEを有効にします ・wxWidgets webviewライブラリを構築する ・Widgets / 3rdparty / webview2 / build /の使用されているアーキテクチャ(x86またはx64)  に対応するサブディレクトリからアプリケーションの実行可能ファイルにWebView2Loader.dllをコピーします ・実行時に、wx.html2.WebView.IsBackendA Enabledを使用して、バックエンドを使用できるかどうかを確認できます (WebView2Loader.dllをロードでき、Edge(Chromium)がインストールされている場合に使用可能になります) ライセンスの要求に応じて、WebView2SDKの使用に関するメモをアプリケーションのドキュメントに必ず追加してください。

wxPythonが古くなったのかと思って、バージョンを確認、そしてUPGしたが、ダメだった

*Python,pipのバージョン確認 python --version pip --version *バージョンアップが必要かを確認した! もちろん、wxPythonのバージョンだよ pip list --outdated *wxPythnをアップグレードする pip install --upgrade wxPython


バージョンを確認( python, pip )


C:\Users\kobay>python --version
Python 3.8.3

C:\Users\kobay>pip --version
pip 21.0 from c:\users\kobay\appdata\local\programs\python\python38\lib\site-packages\pip (python 3.8)




pip が古そうなので UPG した

WARNING: You are using pip version 21.0; however, version 21.0.1 is available.
You should consider upgrading via the 'c:\users\kobay\appdata\local\programs\python\python38\python.exe -m pip install --upgrade pip' command.




コマンドをそのまま、コピペして!


C:\Users\kobay>c:\users\kobay\appdata\local\programs\python\python38\python.exe -m pip install --upgrade pip

Requirement already satisfied: pip in c:\users\kobay\appdata\local\programs\python\python38\lib\site-packages (21.0)
Collecting pip
  Downloading pip-21.0.1-py3-none-any.whl (1.5 MB)
     |■■■■■■■■■■■■| 1.5 MB 119 kB/s
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 21.0
    Uninstalling pip-21.0:
      Successfully uninstalled pip-21.0
Successfully installed pip-21.0.1





本題、wxPythonバージョンアップが必要かを確認した!


C:\Users\kobay>pip list --outdated
Package        Version   Latest    Type
-------------- --------- --------- -----
pywin32        228       300       wheel
requests       2.24.0    2.25.1    wheel
s3transfer     0.3.3     0.3.4     wheel
setuptools     41.2.0    53.0.0    wheel
soupsieve      2.0.1     2.2       wheel
sqlparse       0.3.1     0.4.1     wheel
tqdm           4.47.0    4.56.2    wheel
urllib3        1.25.9    1.26.3    wheel
wxPython       4.1.0     4.1.1     wheel





wxPythnをアップグレードする
(4.1.0から 4.1.1へ) 


C:\Users\kobay>pip install --upgrade wxPython

Requirement already satisfied: wxPython in c:\users\kobay\appdata\local\programs\python\python38\lib\site-packages (4.1.0)
Collecting wxPython
  Downloading wxPython-4.1.1-cp38-cp38-win_amd64.whl (18.1 MB)
     |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■| 18.1 MB 27 kB/s
Requirement already satisfied: pillow in c:\users\kobay\appdata\local\programs\python\python38\lib\site-packages (from wxPython) (7.2.0)
Requirement already satisfied: numpy in c:\users\kobay\appdata\local\programs\python\python38\lib\site-packages (from wxPython) (1.19.0)
Requirement already satisfied: six in c:\users\kobay\appdata\local\programs\python\python38\lib\site-packages (from wxPython) (1.15.0)
Installing collected packages: wxPython
  Attempting uninstall: wxPython
    Found existing installation: wxPython 4.1.0
    Uninstalling wxPython-4.1.0:
      Successfully uninstalled wxPython-4.1.0
Successfully installed wxPython-4.1.1

    
YouTubeWinを実行したが、白いウインドウが出てダメだ~!

参考URL
    Pythonライブラリのインストール - pipの使い方


©2021/02/11 Kenji Kobayashi YouTube